lux.core package

Submodules

lux.core.frame module

class lux.core.frame.LuxDataFrame(*args, **kw)[source]

A subclass of pd.DataFrame that supports all dataframe operations while housing other variables and functions for generating visual recommendations.

expire_metadata()[source]

Expire all saved metadata to trigger a recomputation the next time the data is required.

expire_recs()[source]

Expires and resets all recommendations

render_widget(renderer: str = 'altair', input_current_vis='')[source]

Generate a LuxWidget based on the LuxDataFrame

Structure of widgetJSON:

{

‘current_vis’: {}, ‘recommendation’: [

{

‘action’: ‘Correlation’, ‘description’: “some description”, ‘vspec’: [

{Vega-Lite spec for vis 1}, {Vega-Lite spec for vis 2}, …

]

}, … repeat for other actions

]

}

Parameters:
  • renderer (str, optional) – Choice of visualization rendering library, by default “altair”
  • input_current_vis (lux.LuxDataFrame, optional) – User-specified current vis to override default Current Vis, by default
save_as_html(filename: str = 'export.html') → None[source]

Save dataframe widget as static HTML file

Parameters:filename (str) – Filename for the output HTML file
set_intent_as_vis(vis: lux.vis.Vis.Vis)[source]

Set intent of the dataframe based on the intent of a Vis

Parameters:vis (Vis) – Input Vis object
exported

Get selected visualizations as exported Vis List

Notes

Convert the _selectedVisIdxs dictionary into a programmable VisList Example _selectedVisIdxs :

{‘Correlation’: [0, 2], ‘Occurrence’: [1]}

indicating the 0th and 2nd vis from the Correlation tab is selected, and the 1st vis from the Occurrence tab is selected.

Returns:When there are no exported vis, return empty list -> [] When all the exported vis is from the same tab, return a VisList of selected visualizations. -> VisList(v1, v2…) When the exported vis is from the different tabs, return a dictionary with the action name as key and selected visualizations in the VisList. -> {“Enhance”: VisList(v1, v2…), “Filter”: VisList(v5, v7…), ..}
Return type:Union[Dict[str,VisList], VisList]
intent

Main function to set the intent of the dataframe. The intent input goes through the parser, so that the string inputs are parsed into a lux.Clause object.

Parameters:intent (List[str,Clause]) – intent list, can be a mix of string shorthand or a lux.Clause object

Notes

Specifying Intent in Lux

lux.core.series module

class lux.core.series.LuxSeries(data=None, index=None, dtype=None, name=None, copy=False, fastpath=False)[source]

A subclass of pd.Series that supports all 1-D Series operations

to_pandas() → pandas.core.series.Series[source]

Convert Lux Series to Pandas Series

Returns:
Return type:pd.Series