xl.tools - map(), filter(), and other top-level utilities

xl.tools.apply(func, *rangeIn)

Excel equivalent to the built-in apply().

Ranges as well as Python iterables are accepted. Ranges are converted to lists of Python values (with Range.get()).

The value returned by func is then passed to xl.view

xl.tools.filter(func, range)

Filters rows or columns by applying func to the given range. func is called for each value in the range. If it returns False, the corresponding row / column is hidden. Otherwise, the row / column is made visible.

range must be a row or column vector. If it is a row vector, columns are hidden, and vice versa.

Note that, to unhide rows / columns, range must include hidden cells. For example, to unhide a range:
xl.filter(lambda v: True, some_vector.including_hidden)

Returns a Range for the given table column name, named range, or Excel address (ex. A1:B4). get guesses the active workbook, and begins its search on the active sheet.

See also: xl.Workbook.get and xl.Workbook.range

xl.tools.join(key_range_a, key_range_b)

Joins the table associated with key range B to the table for key range A. Each key in range A must have zero or one matching keys in range B (i.e. rows will not be added to table A)

xl.tools.map(func, *rangeIn)

Excel equivalent to the built-in map().

ColumnVector ranges as well as Python iterables are accepted. The result list is written back to Excel as a column. A ColumnVector representing the stored results is returned


Gets the currently selected range. The returned range filters hidden cells by default


Gets the values in the currently selected range. See xl.selected_range()

xl.tools.view(x, name=None, to=None)

Returns a list of open workbooks

Previous topic

Core API

Next topic

xl.range - Referencing Excel data

This Page