diff --git a/doc/source/whatsnew/v0.23.2.txt b/doc/source/whatsnew/v0.23.2.txt index 5b3e607956f7a..41b18ea1c4634 100644 --- a/doc/source/whatsnew/v0.23.2.txt +++ b/doc/source/whatsnew/v0.23.2.txt @@ -18,7 +18,7 @@ Fixed Regressions - Fixed regression in :meth:`to_csv` when handling file-like object incorrectly (:issue:`21471`) - Bug in both :meth:`DataFrame.first_valid_index` and :meth:`Series.first_valid_index` raised for a row index having duplicate values (:issue:`21441`) -- +- .. _whatsnew_0232.performance: @@ -28,6 +28,9 @@ Performance Improvements - Improved performance of membership checks in :class:`CategoricalIndex` (i.e. ``x in ci``-style checks are much faster). :meth:`CategoricalIndex.contains` is likewise much faster (:issue:`21369`, :issue:`21508`) +- Improved performance of :meth:`HDFStore.groups` (and dependent functions like + :meth:`~HDFStore.keys`. (i.e. ``x in store`` checks are much faster) + (:issue:`21372`) - Improved performance of :meth:`MultiIndex.is_unique` (:issue:`21522`) - diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index aa39e341792c7..aad387e0cdd58 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1098,7 +1098,7 @@ def groups(self): _tables() self._check_if_open() return [ - g for g in self._handle.walk_nodes() + g for g in self._handle.walk_groups() if (not isinstance(g, _table_mod.link.Link) and (getattr(g._v_attrs, 'pandas_type', None) or getattr(g, 'table', None) or