Detail: Batch: Exporter#
- Batch.to_bus(*, index_constructor=None)[source]#
Realize the
Batchas anBus. Note that, as aBusmust have all labels (even ifFrameare loaded lazily), thisBatchwill be exhausted.>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_bus() <Bus> <Index> i Frame j Frame <<U1> <object>
- Batch.to_frame(*, axis=0, union=True, index=None, columns=None, index_constructor=None, columns_constructor=None, name=None, fill_value=nan, consolidate_blocks=False)[source]#
Consolidate stored
Frameinto a newFrameusing the stored labels as the index on the providedaxisusingFrame.from_concat. This assumes that that the containedFramehave been reduced to a single dimension along the provided axis.>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_frame() <Frame> <Index> a b <<U1> <IndexHierarchy> i p 0 1 i q 2 3 i r 4 5 j p 40 41 j q 42 43 j r 44 45 <<U1> <<U1> <int64> <int64>
- Batch.to_series(*, dtype=None, name=None, index_constructor=None)[source]#
Consolidate stored values into a new
Seriesusing the stored labels as the index.>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_series() <Series> <Index> i Frame j Frame <<U1> <object>
- Batch.to_sqlite(fp, /, *, config=None)#
Write the complete
Busas an SQLite database file.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_sqlite('/tmp/f.sqlite')
- Batch.to_visidata()#
Open an interactive VisiData session.
- Batch.to_xlsx(fp, /, *, config=None)#
Write the complete
Busas a XLSX workbook.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_xlsx('/tmp/f.xlsx')
- Batch.to_zip_csv(fp, /, *, config=None, compression=8)#
Write the complete
Busas a zipped archive of CSV files.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_zip_csv('/tmp/f.zip')
- Batch.to_zip_npy(fp, /, *, config=None, compression=8)#
Write the complete
Busas a zipped archive of NPY files.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_zip_npy('/tmp/f.zip')
- Batch.to_zip_npz(fp, /, *, config=None, compression=8)#
Write the complete
Busas a zipped archive of NPZ files.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_zip_npz('/tmp/f.zip')
- Batch.to_zip_parquet(fp, /, *, config=None, compression=8)#
Write the complete
Busas a zipped archive of parquet files.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_zip_parquet('/tmp/f.zip')
- Batch.to_zip_pickle(fp, /, *, config=None, compression=8)#
Write the complete
Busas a zipped archive of pickles.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_zip_pickle('/tmp/f.zip')
- Batch.to_zip_tsv(fp, /, *, config=None, compression=8)#
Write the complete
Busas a zipped archive of TSV files.- Parameters:
fp – A string file path or
Pathinstance.config – A
StoreConfig, or a mapping of label toStoreConfigcompression – Provide a zip compression setting using values from the Python
zipfilemodule;zipfile.ZIP_DEFLATEDis standard zlib compression;zipfile.ZIP_STOREDdisables compression and may give better performance at the cost of larger file sizes.
>>> bt1 = sf.Batch((('i', sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x')), ('j', sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')))) >>> bt1.to_zip_tsv('/tmp/f.zip')
Batch: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Transpose | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic | Accessor Reduce