fugue.bag
fugue.bag.array_bag
- class fugue.bag.array_bag.ArrayBag(data, copy=True)[source]
Bases:
LocalBoundedBag
- Parameters:
data (Any)
copy (bool)
- as_array()[source]
Convert to a native python array
- Returns:
the native python array
- Return type:
List[Any]
- property empty: bool
Whether this dataframe is empty
- head(n)[source]
Take the first n elements
- Returns:
the python array of the first n elements
- Parameters:
n (int)
- Return type:
- property native: List[Any]
The underlying Python list object
- peek()[source]
Peek the first row of the dataframe as array
- Raises:
FugueDatasetEmptyError – if it is empty
- Return type:
Any
fugue.bag.bag
- class fugue.bag.bag.Bag[source]
Bases:
Dataset
The base class of Fugue Bags. Bag contains a collection of unordered objects.
- abstract as_array()[source]
Convert to a native python array
- Returns:
the native python array
- Return type:
List[Any]
- abstract as_local_bounded()[source]
Convert this bag to a
LocalBoundedBag
- Return type:
- abstract head(n)[source]
Take the first n elements
- Returns:
the python array of the first n elements
- Parameters:
n (int)
- Return type:
- abstract peek()[source]
Peek the first row of the dataframe as array
- Raises:
FugueDatasetEmptyError – if it is empty
- Return type:
Any
- class fugue.bag.bag.BagDisplay(ds)[source]
Bases:
DatasetDisplay
Bag
plain display class- Parameters:
ds (Dataset)
- class fugue.bag.bag.LocalBag[source]
Bases:
Bag
- property is_local: bool
Whether this dataframe is a local Dataset
- property num_partitions: int
Number of physical partitions of this dataframe. Please read the Partition Tutorial