Transform#
- class lumen.transforms.base.Transform(*, controls, name)#
Transform components implement transforms of DataFrame objects.
Parameters#
type: list
default: []
Parameters that should be exposed as widgets in the UI.
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 transform implement the filtering behavior of Filter components.
HistoryTransform accumulates a history of the queried data.
Aggregate one or more columns or indexes, see pandas.DataFrame.groupby.
Sort on one or more columns, see pandas.DataFrame.sort_values.
Query applies the pandas.DataFrame.query method.
Columns selects a subset of columns.
Astype transforms the type of one or more columns.
Stack applies pandas.DataFrame.stack to the declared level.
Unstack applies pandas.DataFrame.unstack to the declared level.
Iloc allows selecting the data with integer indexing, see pandas.DataFrame.iloc.
Sample returns a random sample of items.
Compute turns a dask.dataframe.DataFrame into a pandas.DataFrame.
Pivot applies pandas.DataFrame.pivot given an index, columns, and values.
PivotTable applies pandas.pivot_table` to the data.
Melt applies the pandas.melt operation given the id_vars and value_vars.
SetIndex promotes DataFrame columns to indexes, see pandas.DataFrame.set_index.
ResetIndex resets DataFrame indexes to columns or drops them, see pandas.DataFrame.reset_index
Rename renames columns or indexes, see pandas.DataFrame.rename.
Set the name of the axis for the index or columns,
Counts non-nan values in each column of the DataFrame and returns
Sums numeric values in each column of the DataFrame and returns a
Applies an eval assignment expression to a DataFrame. The
DropNA drops rows with any missing values.
Corr computes pairwise correlation of columns, excluding NA/null values.
project_lnglat projects the given longitude/latitude columns to Web Mercator.
Format SQL expressions with parameterized replacements.
Performs a Group-By and aggregation
Performs a LIMIT SQL operation on the query.
SQLDistinct Transform
SQLCount Transform
SQLMinMax Transform
SQLColumns Transform
SQLFilter Transform
SQLOverride Transform
Samples rows from a SQL query using TABLESAMPLE or similar functionality,
Class to exclude the source and separator.
SQLSelectFrom Transform