Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « pandas »

Classe « HDFStore »

Informations générales

Héritage

builtins.object
    HDFStore

Définition

class HDFStore(builtins.object):

Description [extrait de HDFStore.__doc__]

    Dict-like IO interface for storing pandas objects in PyTables.

    Either Fixed or Table format.

    .. warning::

       Pandas uses PyTables for reading and writing HDF5 files, which allows
       serializing object-dtype data with pickle when using the "fixed" format.
       Loading pickled data received from untrusted sources can be unsafe.

       See: https://docs.python.org/3/library/pickle.html for more.

    Parameters
    ----------
    path : str
        File path to HDF5 file.
    mode : {'a', 'w', 'r', 'r+'}, default 'a'

        ``'r'``
            Read-only; no data can be modified.
        ``'w'``
            Write; a new file is created (an existing file with the same
            name would be deleted).
        ``'a'``
            Append; an existing file is opened for reading and writing,
            and if the file does not exist it is created.
        ``'r+'``
            It is similar to ``'a'``, but the file must already exist.
    complevel : int, 0-9, default None
        Specifies a compression level for data.
        A value of 0 or None disables compression.
    complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib'
        Specifies the compression library to be used.
        As of v0.20.2 these additional compressors for Blosc are supported
        (default if no compressor specified: 'blosc:blosclz'):
        {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',
         'blosc:zlib', 'blosc:zstd'}.
        Specifying a compression library which is not available issues
        a ValueError.
    fletcher32 : bool, default False
        If applying compression use the fletcher32 checksum.
    **kwargs
        These parameters will be passed to the PyTables open_file method.

    Examples
    --------
    >>> bar = pd.DataFrame(np.random.randn(10, 4))
    >>> store = pd.HDFStore('test.h5')
    >>> store['foo'] = bar   # write to HDF5
    >>> bar = store['foo']   # retrieve
    >>> store.close()

    **Create or load HDF5 file in-memory**

    When passing the `driver` option to the PyTables open_file method through
    **kwargs, the HDF5 file is loaded or created in-memory and will only be
    written when closed:

    >>> bar = pd.DataFrame(np.random.randn(10, 4))
    >>> store = pd.HDFStore('test.h5', driver='H5FD_CORE')
    >>> store['foo'] = bar
    >>> store.close()   # only now, data is written to disk
    

Constructeur(s)

Signature du constructeur Description
__init__(self, path, mode: str = 'a', complevel: Optional[int] = None, complib=None, fletcher32: bool = False, **kwargs)

Liste des propriétés

Nom de la propriétéDescription
filename
is_open
rootreturn the root node [extrait de __doc__]

Liste des opérateurs

Signature de l'opérateur Description
__contains__(self, key: str) -> bool
__delitem__(self, key: str)
__getitem__(self, key: str)
__setitem__(self, key: str, value)

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__enter__(self)
__exit__(self, exc_type, exc_value, traceback)
__fspath__(self)
__getattr__(self, name: str) allow attribute access to get stores [extrait de __getattr__.__doc__]
__iter__(self)
__len__(self) -> int
__repr__(self) -> str
append(self, key: str, value: ~FrameOrSeries, format=None, axes=None, index=True, append=True, complib=None, complevel: Optional[int] = None, columns=None, min_itemsize: Union[int, Dict[str, int], NoneType] = None, nan_rep=None, chunksize=None, expectedrows=None, dropna: Optional[bool] = None, data_columns: Optional[List[str]] = None, encoding=None, errors: str = 'strict')
append_to_multiple(self, d: Dict, value, selector, data_columns=None, axes=None, dropna=False, **kwargs)
close(self)
copy(self, file, mode='w', propindexes: bool = True, keys=None, complib=None, complevel: Optional[int] = None, fletcher32: bool = False, overwrite=True)
create_table_index(self, key: str, columns=None, optlevel: Optional[int] = None, kind: Optional[str] = None)
flush(self, fsync: bool = False)
get(self, key: str)
get_node(self, key: str) -> Optional[ForwardRef('Node')] return the node with the key or None if it does not exist [extrait de get_node.__doc__]
get_storer(self, key: str) -> Union[ForwardRef('GenericFixed'), ForwardRef('Table')] return the storer object for a key, raise if not in the file [extrait de get_storer.__doc__]
groups(self)
info(self) -> str
items(self)
iteritems(self)
keys(self, include: str = 'pandas') -> List[str]
open(self, mode: str = 'a', **kwargs)
put(self, key: str, value: ~FrameOrSeries, format=None, index=True, append=False, complib=None, complevel: Optional[int] = None, min_itemsize: Union[int, Dict[str, int], NoneType] = None, nan_rep=None, data_columns: Optional[List[str]] = None, encoding=None, errors: str = 'strict', track_times: bool = True, dropna: bool = False)
remove(self, key: str, where=None, start=None, stop=None)
select(self, key: str, where=None, start=None, stop=None, columns=None, iterator=False, chunksize=None, auto_close: bool = False)
select_as_coordinates(self, key: str, where=None, start: Optional[int] = None, stop: Optional[int] = None)
select_as_multiple(self, keys, where=None, selector=None, columns=None, start=None, stop=None, iterator=False, chunksize=None, auto_close: bool = False)
select_column(self, key: str, column: str, start: Optional[int] = None, stop: Optional[int] = None)
walk(self, where='/')

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__