Collection#
- class grove.Collection(data_sources=None)#
A container class to manage DataFrames. Each DataFrame is stored with a string name and is accessible via indexing or attribute name.
Example
>>> import pandas as pd >>> import grove >>> df = pd.read_csv('c.csv') >>> >>> data = grove.Collection({'A': 'a.csv', ... 'B': 'b.tsv', ... 'C': df}) >>> data['D'] = 'd.tsv' >>> data['A'] >>> data.B >>> data.C
Note
For attribute access, the Collection class attribute names (e.g.
show_schema) take precedence and will be returned instead.
Constructor#
|
One can create an empty collection and add DataFrames iteratively, or initialize from a list / dictionary specifying DataFrames and names. |
Methods#
|
Iteratively print head() for all DataFrames in the Collection. |
|
Print information about the collection. |
|
Merge multiple DataFrames in the Collection (as an inner join). |
|
Minimize the Collection memory usage, by using the smallest applicable Numpy datatypes for all integer and float columns, in all included DataFrames. |
Iteratively check for typical desirable data properties for all Collection DataFrames. |
Attributes#
Get the sorted list of DataFrame names in the Collection. |