graviti.dataframe.column.series
#
The implementation of the Graviti Series.
Module Contents#
Classes#
One-dimensional array. |
|
One-dimensional array. |
|
One-dimensional array for portex builtin type array. |
|
One-dimensional array for file. |
|
One-dimensional array for portex builtin type enum. |
- class graviti.dataframe.column.series.SeriesBase[source]#
Bases:
graviti.dataframe.container.Container
One-dimensional array.
- Parameters
data – The data that needs to be stored in Series. Could be ndarray or Iterable.
schema – Data type to force. If None, will be inferred from
data
.
Examples
Constructing Series from a list.
>>> d = [1,2,3,4] >>> series = Series(data=d) >>> series 0 1 1 2 2 3 3 4
- property iloc(self)[source]#
Purely integer-location based indexing for selection by position.
Allowed inputs are:
An integer, e.g.
5
.A list or array of integers, e.g.
[4, 3, 0]
.A slice object with ints, e.g.
1:7
.A boolean array of the same length as the axis being sliced.
- Returns
The instance of the ILocIndexer.
- Return type
Examples
>>> series = Series([1, 2, 3]) >>> series.loc[0] 1 >>> df.loc[[0]] 0 1 dtype: int64
- property loc(self)[source]#
Access a group of rows and columns by indexes or a boolean array.
Allowed inputs are:
A single index, e.g.
5
.A list or array of indexes, e.g.
[4, 3, 0]
.A slice object with indexes, e.g.
1:7
.A boolean array of the same length as the axis being sliced.
- Returns
The instance of the LocIndexer.
- Return type
Examples
>>> series = Series([1, 2, 3]) >>> series.loc[0] 1 >>> df.loc[[0]] 0 1 dtype: int64
- classmethod from_pyarrow(cls, array, schema=None)[source]#
Instantiate a Series backed by an pyarrow array.
- Parameters
array (pyarrow.Array) – The input pyarrow array.
schema (Optional[graviti.portex.PortexType]) – The schema of the series. If None, will be inferred from array.
cls (Type[_SB]) –
- Raises
TypeError – When the schema is mismatched with the pyarrow array type.
- Returns
The loaded
Series
instance.- Return type
_SB
- class graviti.dataframe.column.series.Series[source]#
Bases:
SeriesBase
One-dimensional array.
- Parameters
data – The data that needs to be stored in Series. Could be ndarray or Iterable.
schema – Data type to force. If None, will be inferred from
data
.
Examples
Constructing Series from a list.
>>> d = [1,2,3,4] >>> series = Series(data=d) >>> series 0 1 1 2 2 3 3 4
- class graviti.dataframe.column.series.ArraySeries[source]#
Bases:
SeriesBase
One-dimensional array for portex builtin type array.