UserSpace.new_cells_from_pandas#
- UserSpace.new_cells_from_pandas(obj, cells=None, param=None)[source]#
Create new cells from Pandas Series or DataFrame object.
Warning
This method is deprecated.
Return new cells created from Pandas Series or DataFrame object passed as
obj.objcan either be a Series or a DataFrame. Ifobjis a Series, a single cells is created. The cells’ name is taken from the Series’ name, but can be overwritten if a valid name is passed ascells.If
objis a DataFrame, a cells is created for each column. The cells’ names can be overwritten by a sequence of valid names passed ascellsKeys and values of the cells data are copied from
obj.objcan have MultiIndex. If the index(es) ofobjhas/have name(s), the parameter name(s) of the cells is/are set to the name(s), but can be overwritten byparamparameter. If the index(es) ofobjhas/have no name(s), andparamis not given, error is raised. Error is raised whenobjhas duplicated indexes.- Parameters:
obj – Pandas Series or DataFrame object
cells (str, optional) – cells name. If
objhas a valid name and thiscellsis not given, the name is used. Ifobjdoes not have a name and thiscellsis not given, the cells is named automatically.param – sequence of strings to set parameter name(s). A single string can also be passed to set a single parameter name when
objhas a single level index (i.e. not MultiIndex).
- Returns:
New cells if
objis a Series, CellsView ifobjis DataFrame.
See also
new_space_from_pandas(): Create Spaces and Cells from DataFrame or Series.Changed in version 0.20.0: this method is deprecated.