@@ -1476,6 +1476,17 @@ def groups(self) -> list:
1476
1476
-------
1477
1477
list
1478
1478
List of objects.
1479
+
1480
+ Examples
1481
+ --------
1482
+ >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B'])
1483
+ >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP
1484
+ >>> store.put('data', df) # doctest: +SKIP
1485
+ >>> print(store.groups()) # doctest: +SKIP
1486
+ >>> store.close() # doctest: +SKIP
1487
+ [/data (Group) ''
1488
+ children := ['axis0' (Array), 'axis1' (Array), 'block0_values' (Array),
1489
+ 'block0_items' (Array)]]
1479
1490
"""
1480
1491
_tables ()
1481
1492
self ._check_if_open ()
@@ -1520,6 +1531,18 @@ def walk(self, where: str = "/") -> Iterator[tuple[str, list[str], list[str]]]:
1520
1531
Names (strings) of the groups contained in `path`.
1521
1532
leaves : list
1522
1533
Names (strings) of the pandas objects contained in `path`.
1534
+
1535
+ Examples
1536
+ --------
1537
+ >>> df1 = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B'])
1538
+ >>> store = pd.HDFStore("store.h5", 'w') # doctest: +SKIP
1539
+ >>> store.put('data', df1, format='table') # doctest: +SKIP
1540
+ >>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=['A', 'B'])
1541
+ >>> store.append('data', df2) # doctest: +SKIP
1542
+ >>> store.close() # doctest: +SKIP
1543
+ >>> for group in store.walk(): # doctest: +SKIP
1544
+ ... print(group) # doctest: +SKIP
1545
+ >>> store.close() # doctest: +SKIP
1523
1546
"""
1524
1547
_tables ()
1525
1548
self ._check_if_open ()
0 commit comments