sciris.sc_legacy.legacy_dataframe¶
- class sciris.sc_legacy.legacy_dataframe(cols=None, data=None, nrows=None)[source]¶
Bases:
object
This legacy dataframe is maintained solely to allow loading old files.
Example:
import sciris as sc from sciris import sc_legacy as scl remapping = {'sciris.sc_dataframe.dataframe':scl.legacy_dataframe} old = sc.load('my-old-file.obj', remapping=remapping)
Version: 2020nov29Migrated tosc_legacy
in version 2.0.0.Attributes
Get the number of columns in the data frame
Get the number of rows in the data frame
Equivalent to the shape of the data array, minus the headers
Methods
Creates a dataframe from the supplied input data.
- property ncols¶
Get the number of columns in the data frame
- property nrows¶
Get the number of rows in the data frame
- property shape¶
Equivalent to the shape of the data array, minus the headers
- make(cols=None, data=None, nrows=None)[source]¶
Creates a dataframe from the supplied input data.
Usage examples:
df = sc.dataframe() df = sc.dataframe(['a','b','c']) df = sc.dataframe(['a','b','c'], nrows=2) df = sc.dataframe([['a','b','c'],[1,2,3],[4,5,6]]) df = sc.dataframe(['a','b','c'], [[1,2,3],[4,5,6]]) df = sc.dataframe(cols=['a','b','c'], data=[[1,2,3],[4,5,6]])