orso
orso is a DataFrame library.
class DataFrame (dictionaries)
-
Constructors
DataFrame (dictionaries)
-
Parameters
- dictionaries: iterable of dicts
- An Iterable (list, tuple, generator) of Python dicts. Where the dicts have different fields, only the fields from the first dict are used to determine the schema. Missing values are filled with Nones.
DataFrame.from_arrow (table)
-
Parameters
- table: pyarrow.Table
- Return an orso DataFrame representation of a pyarrow.Table.
Properties
- column_names tuple of strings
- The names of the columns in the DataFrame.
- columncount int
- The number of columns in the DataFrame.
- rowcount int
- The number of rows in the DataFrame.
Functions
- def append (row) -> None
-
Appends a row to the DataFrame.
Parameters
-
row: Tuple
Tuple containing the data for the new row. - def collect (columns) -> list, list of lists
-
Collects specified columns from the internal row storage into a tuple of lists.
Parameters
-
columns: int, str, list of int, list of str
Integer index, string name, or list of columns to collect.Returns
list, if a single column has been specified. list of lists, if multiple columns have been specified.
- def slice (offset, length=None) -> DataFrame
-
Returns a sliced DataFrame.
Parameters
-
offset: int
Start index for the slice. length: int, optional
Length of the slice.Returns
A new DataFrame containing the sliced data.
- def filter (mask) -> DataFrame
-
Select rows from the DataFrame based on a boolean array.
Parameters
-
mask: boolean array
Boolean array for filtering rows.Returns
A new DataFrame containing the filtered data.
- def take (indexes) -> DataFrame
-
Select rows from the DataFrame based on their index.
Parameters
-
indexes: list of int
List of row indexes to take.Returns
A new DataFrame containing the specified rows.
- def row (i) -> Row
-
Returns a single row from the DataFrame.
Parameters
-
i: int
Index of the row.Returns
A Row object.
- def fetchone () -> Row or None
-
Fetches a single row from the DataFrame.
Returns
A Row object or None if no more rows are available.
- def fetchmany (size=None) -> list of Row
-
Fetches multiple rows from the DataFrame.
Parameters
-
size: int, optional
Number of rows to fetch (defaults to arraysize).Returns
A list of Row objects.
- def fetchall () -> list of Row
-
Fetches all rows from the DataFrame.
Returns
A list of all Row objects in the DataFrame.