@@ -431,8 +431,9 @@ def _is_metadata_of(group, parent_group):
431
431
class HDFStore :
432
432
433
433
"""
434
- Dict-like IO interface for storing pandas objects in PyTables
435
- either Fixed or Table format.
434
+ Dict-like IO interface for storing pandas objects in PyTables.
435
+
436
+ Either Fixed or Table format.
436
437
437
438
Parameters
438
439
----------
@@ -564,13 +565,12 @@ def __exit__(self, exc_type, exc_value, traceback):
564
565
565
566
def keys (self ):
566
567
"""
567
- Return a (potentially unordered) list of the keys corresponding to the
568
- objects stored in the HDFStore. These are ABSOLUTE path-names (e.g.
569
- have the leading '/'
568
+ Return a list of keys corresponding to objects stored in HDFStore.
570
569
571
570
Returns
572
571
-------
573
572
list
573
+ List of ABSOLUTE path-names (e.g. have the leading '/').
574
574
"""
575
575
return [n ._v_pathname for n in self .groups ()]
576
576
@@ -703,15 +703,16 @@ def flush(self, fsync=False):
703
703
704
704
def get (self , key ):
705
705
"""
706
- Retrieve pandas object stored in file
706
+ Retrieve pandas object stored in file.
707
707
708
708
Parameters
709
709
----------
710
710
key : object
711
711
712
712
Returns
713
713
-------
714
- obj : same type as object stored in file
714
+ object
715
+ Same type as object stored in file.
715
716
"""
716
717
group = self .get_node (key )
717
718
if group is None :
@@ -731,25 +732,31 @@ def select(
731
732
** kwargs
732
733
):
733
734
"""
734
- Retrieve pandas object stored in file, optionally based on where
735
- criteria
735
+ Retrieve pandas object stored in file, optionally based on where criteria.
736
736
737
737
Parameters
738
738
----------
739
739
key : object
740
- where : list of Term (or convertible) objects, optional
741
- start : integer (defaults to None), row number to start selection
742
- stop : integer (defaults to None), row number to stop selection
743
- columns : a list of columns that if not None, will limit the return
744
- columns
745
- iterator : boolean, return an iterator, default False
746
- chunksize : nrows to include in iteration, return an iterator
747
- auto_close : boolean, should automatically close the store when
748
- finished, default is False
740
+ Object being retrieved from file.
741
+ where : list, default None
742
+ List of Term (or convertible) objects, optional.
743
+ start : int, default None
744
+ Row number to start selection.
745
+ stop : int, default None
746
+ Row number to stop selection.
747
+ columns : list, default None
748
+ A list of columns that if not None, will limit the return columns.
749
+ iterator : bool, default False
750
+ Returns an iterator.
751
+ chunksize : int, default None
752
+ Number or rows to include in iteration, return an iterator.
753
+ auto_close : bool, default False
754
+ Should automatically close the store when finished.
749
755
750
756
Returns
751
757
-------
752
- The selected object
758
+ object
759
+ Retrieved object from file.
753
760
"""
754
761
group = self .get_node (key )
755
762
if group is None :
@@ -929,28 +936,30 @@ def func(_start, _stop, _where):
929
936
930
937
def put (self , key , value , format = None , append = False , ** kwargs ):
931
938
"""
932
- Store object in HDFStore
939
+ Store object in HDFStore.
933
940
934
941
Parameters
935
942
----------
936
- key : object
937
- value : {Series, DataFrame}
938
- format : 'fixed(f)|table(t)', default is 'fixed'
943
+ key : object
944
+ value : {Series, DataFrame}
945
+ format : 'fixed(f)|table(t)', default is 'fixed'
939
946
fixed(f) : Fixed format
940
- Fast writing/reading. Not-appendable, nor searchable
947
+ Fast writing/reading. Not-appendable, nor searchable.
941
948
table(t) : Table format
942
949
Write as a PyTables Table structure which may perform
943
950
worse but allow more flexible operations like searching
944
- / selecting subsets of the data
945
- append : boolean , default False
951
+ / selecting subsets of the data.
952
+ append : bool , default False
946
953
This will force Table format, append the input data to the
947
954
existing.
948
- data_columns : list of columns to create as data columns, or True to
955
+ data_columns : list, default None
956
+ List of columns to create as data columns, or True to
949
957
use all columns. See `here
950
958
<http://pandas.pydata.org/pandas-docs/stable/user_guide/io.html#query-via-data-columns>`__.
951
- encoding : default None, provide an encoding for strings
952
- dropna : boolean, default False, do not write an ALL nan row to
953
- the store settable by the option 'io.hdf.dropna_table'
959
+ encoding : str, default None
960
+ Provide an encoding for strings.
961
+ dropna : bool, default False, do not write an ALL nan row to
962
+ The store settable by the option 'io.hdf.dropna_table'.
954
963
"""
955
964
if format is None :
956
965
format = get_option ("io.hdf.default_format" ) or "fixed"
@@ -1165,12 +1174,15 @@ def create_table_index(self, key, **kwargs):
1165
1174
s .create_index (** kwargs )
1166
1175
1167
1176
def groups (self ):
1168
- """return a list of all the top-level nodes (that are not themselves a
1169
- pandas storage object)
1177
+ """
1178
+ Return a list of all the top-level nodes.
1179
+
1180
+ Each node returned is not a pandas storage object.
1170
1181
1171
1182
Returns
1172
1183
-------
1173
1184
list
1185
+ List of objects.
1174
1186
"""
1175
1187
_tables ()
1176
1188
self ._check_if_open ()
@@ -1188,10 +1200,12 @@ def groups(self):
1188
1200
]
1189
1201
1190
1202
def walk (self , where = "/" ):
1191
- """ Walk the pytables group hierarchy for pandas objects
1203
+ """
1204
+ Walk the pytables group hierarchy for pandas objects.
1192
1205
1193
1206
This generator will yield the group path, subgroups and pandas object
1194
1207
names for each group.
1208
+
1195
1209
Any non-pandas PyTables objects that are not a group will be ignored.
1196
1210
1197
1211
The `where` group itself is listed first (preorder), then each of its
@@ -1202,18 +1216,17 @@ def walk(self, where="/"):
1202
1216
1203
1217
Parameters
1204
1218
----------
1205
- where : str, optional
1219
+ where : str, default "/"
1206
1220
Group where to start walking.
1207
- If not supplied, the root group is used.
1208
1221
1209
1222
Yields
1210
1223
------
1211
1224
path : str
1212
- Full path to a group (without trailing '/')
1213
- groups : list of str
1214
- names of the groups contained in `path`
1215
- leaves : list of str
1216
- names of the pandas objects contained in `path`
1225
+ Full path to a group (without trailing '/').
1226
+ groups : list
1227
+ Names (strings) of the groups contained in `path`.
1228
+ leaves : list
1229
+ Names (strings) of the pandas objects contained in `path`.
1217
1230
"""
1218
1231
_tables ()
1219
1232
self ._check_if_open ()
0 commit comments