Detail: Quilt: Exporter

Overview: Quilt: Exporter

Quilt.to_frame()[source]

Return a consolidated Frame.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q1 = sf.Quilt(b, retain_labels=True)
>>> q1.to_frame()
<Frame>
<Index>                a       b       <<U1>
<IndexHierarchy>
x                p     0       1
x                q     2       3
x                r     4       5
v                p     40      41
v                q     42      43
v                r     44      45
<<U1>            <<U1> <int64> <int64>
Quilt.to_hdf5(fp, *, config=None)

Write the complete Bus as an HDF5 table.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_hdf5('/tmp/q.h5')
Quilt.to_sqlite(fp, *, config=None)

Write the complete Bus as an SQLite database file.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_sqlite('/tmp/q.db')
Quilt.to_visidata()

Open an interactive VisiData session.

Quilt.to_xlsx(fp, *, config=None)

Write the complete Bus as a XLSX workbook.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_xlsx('/tmp/q.xlsx')
Quilt.to_zip_csv(fp, *, config=None, compression=8)

Write the complete Bus as a zipped archive of CSV files.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_zip_csv('/tmp/q.zip')
Quilt.to_zip_npy(fp, *, config=None, compression=8)

Write the complete Bus as a zipped archive of NPY files.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_zip_npy('/tmp/q.zip')
Quilt.to_zip_npz(fp, *, config=None, compression=8)

Write the complete Bus as a zipped archive of NPZ files.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_zip_npz('/tmp/q.zip')
Quilt.to_zip_parquet(fp, *, config=None, compression=8)

Write the complete Bus as a zipped archive of parquet files.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_zip_parquet('/tmp/q.zip')
Quilt.to_zip_pickle(fp, *, config=None, compression=8)

Write the complete Bus as a zipped archive of pickles.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_zip_pickle('/tmp/q.zip')
Quilt.to_zip_tsv(fp, *, config=None, compression=8)

Write the complete Bus as a zipped archive of TSV files.

Parameters
  • fp – A string file path or Path instance.

  • config – A StoreConfig, or a mapping of label ot StoreConfig

  • compression – Provide a zip compression setting using values from the Python zipfile module; zipfile.ZIP_DEFLATED is standard zlib compression; zipfile.ZIP_STORED disables compression and may give better performance at the cost of larger file sizes.

>>> b = sf.Bus.from_frames((sf.Frame(np.arange(6).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='x'), sf.Frame(np.arange(40, 46).reshape(3,2), index=('p', 'q', 'r'), columns=('a', 'b'), name='v')), name='j')
>>> q = sf.Quilt(b, retain_labels=True)
>>> q.to_zip_tsv('/tmp/q.zip')

Quilt: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Accessor Hashlib