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 :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « HDFStore »

Méthode pandas.HDFStore.walk

Signature de la méthode walk

def walk(self, where: 'str' = '/') -> 'Iterator[tuple[str, list[str], list[str]]]' 

Description

help(HDFStore.walk)

Walk the pytables group hierarchy for pandas objects.

This generator will yield the group path, subgroups and pandas object
names for each group.

Any non-pandas PyTables objects that are not a group will be ignored.

The `where` group itself is listed first (preorder), then each of its
child groups (following an alphanumerical order) is also traversed,
following the same procedure.

Parameters
----------
where : str, default "/"
    Group where to start walking.

Yields
------
path : str
    Full path to a group (without trailing '/').
groups : list
    Names (strings) of the groups contained in `path`.
leaves : list
    Names (strings) of the pandas objects contained in `path`.

Examples
--------
>>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B'])
>>> store = pd.HDFStore("store.h5", 'w')  # doctest: +SKIP
>>> store.put('data', df1, format='table')  # doctest: +SKIP
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=['A', 'B'])
>>> store.append('data', df2)  # doctest: +SKIP
>>> store.close()  # doctest: +SKIP
>>> for group in store.walk():  # doctest: +SKIP
...     print(group)  # doctest: +SKIP
>>> store.close()  # doctest: +SKIP


Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé