Transform#

class lumen.transforms.base.Transform(*, controls, name)#

Transform components implement transforms of DataFrame objects.


Parameters#

controls

type: list[Any]
default: []
Parameters that should be exposed as widgets in the UI.

name

type: str
default: 'Transform'
String identifier for this object.


Methods#

Transform.apply(table: DataFrame) DataFrame#

Given a table transform it in some way and return it.

Parameters:

table (DataFrame) – The queried table as a DataFrame.

Returns:

A DataFrame containing the transformed data.

Return type:

DataFrame

Transform.to_spec(context: Dict[str, Any] | None = None) Dict[str, Any]#

Exports the full specification to reconstruct this component.

Return type:

Resolved and instantiated Component object

Types#

Filter type: None

Filter transform implement the filtering behavior of Filter components.

Filter.html
HistoryTransform type: history

HistoryTransform accumulates a history of the queried data.

HistoryTransform.html
Aggregate type: aggregate

Aggregate one or more columns or indexes, see pandas.DataFrame.groupby.

Aggregate.html
Sort type: sort

Sort on one or more columns, see pandas.DataFrame.sort_values.

Sort.html
Query type: query

Query applies the pandas.DataFrame.query method.

Query.html
Columns type: columns

Columns selects a subset of columns.

Columns.html
Astype type: as_type

Astype transforms the type of one or more columns.

Astype.html
Stack type: stack

Stack applies pandas.DataFrame.stack to the declared level.

Stack.html
Unstack type: unstack

Unstack applies pandas.DataFrame.unstack to the declared level.

Unstack.html
Iloc type: iloc

Iloc allows selecting the data with integer indexing, see pandas.DataFrame.iloc.

Iloc.html
Sample type: sample

Sample returns a random sample of items.

Sample.html
Compute type: compute

Compute turns a dask.dataframe.DataFrame into a pandas.DataFrame.

Compute.html
Pivot type: pivot

Pivot applies pandas.DataFrame.pivot given an index, columns, and values.

Pivot.html
Melt type: melt

Melt applies the pandas.melt operation given the id_vars and value_vars.

Melt.html
SetIndex type: set_index

SetIndex promotes DataFrame columns to indexes, see pandas.DataFrame.set_index.

SetIndex.html
ResetIndex type: reset_index

ResetIndex resets DataFrame indexes to columns or drops them, see pandas.DataFrame.reset_index

ResetIndex.html
Rename type: rename

Rename renames columns or indexes, see pandas.DataFrame.rename.

Rename.html
RenameAxis type: rename_axis

Set the name of the axis for the index or columns,

RenameAxis.html
Count type: count

Counts non-nan values in each column of the DataFrame and returns

Count.html
Sum type: sum

Sums numeric values in each column of the DataFrame and returns a

Sum.html
Eval type: eval

Applies an eval assignment expression to a DataFrame. The

Eval.html
DropNA type: dropna

DropNA drops rows with any missing values.

DropNA.html
project_lnglat type: project_lnglat

project_lnglat projects the given longitude/latitude columns to Web Mercator.

project_lnglat.html
SQLGroupBy type: sql_group_by

Performs a Group-By and aggregation

SQLGroupBy.html
SQLLimit type: sql_limit

Performs a LIMIT SQL operation on the query

SQLLimit.html
SQLDistinct type: sql_distinct

SQLDistinct Transform

SQLDistinct.html
SQLMinMax type: sql_minmax

SQLMinMax Transform

SQLMinMax.html
SQLColumns type: sql_columns

SQLColumns Transform

SQLColumns.html
SQLFilter type: sql_filter

Translates Lumen Filter query into a SQL WHERE statement.

SQLFilter.html