tiled.client.sparse.SparseClient.export

SparseClient.export(filepath, *, format=None, slice=None)[source]

Download data in some format and write to a file.

Parameters
file: str or buffer

Filepath or writeable buffer.

formatstr, optional

If format is None and file is a filepath, the format is inferred from the name, like ‘table.csv’ implies format=”text/csv”. The format may be given as a file extension (“csv”) or a media type (“text/csv”).

sliceList[slice], optional

List of slice objects. A convenient way to generate these is shown in the examples.

Examples

Export all.

>>> a.export("numbers.csv")

Export an N-dimensional slice.

>>> import numpy
>>> a.export("numbers.csv", slice=numpy.s_[:10, 50:100])