@@ -346,7 +346,7 @@ class LHDFStore(object):
346
346
Parameters
347
347
----------
348
348
filepath : str or PathLike object
349
- File path to HDF5 file
349
+ File path to HDF5 file.
350
350
mode : {'a', 'w', 'r', 'r+'}, default 'a'
351
351
352
352
``'r'``
@@ -562,13 +562,13 @@ def put(self, key, value, **kwargs):
562
562
563
563
564
564
def read_hdf (filepath_or_buffer , key , fill_value = nan , na = nan , sort_rows = False , sort_columns = False ,
565
- name = None , ** kwargs ):
565
+ name = None , engine = 'auto' , ** kwargs ):
566
566
r"""Reads an axis or group or array named key from a HDF5 file in filepath (path+name)
567
567
568
568
Parameters
569
569
----------
570
- filepath_or_buffer : str or LArrayHDFStore
571
- Path and name where the HDF5 file is stored or a HDFStore object .
570
+ filepath_or_buffer : str or PathLike object
571
+ Path and name where the HDF5 file is stored.
572
572
key : str or Group
573
573
Name of the object to read.
574
574
fill_value : scalar or LArray, optional
@@ -585,6 +585,9 @@ def read_hdf(filepath_or_buffer, key, fill_value=nan, na=nan, sort_rows=False, s
585
585
name : str, optional
586
586
Name of the axis or group to return. If None, name is set to passed key.
587
587
Defaults to None.
588
+ engine: {'auto', 'tables', 'pandas'}, optional
589
+ Load using `engine`. Use 'pandas' to read an HDF file generated with a LArray version previous to 0.31.
590
+ Defaults to 'auto' (use default engine if you don't know the LArray version used to produced the HDF file).
588
591
589
592
Returns
590
593
-------
@@ -610,7 +613,7 @@ def read_hdf(filepath_or_buffer, key, fill_value=nan, na=nan, sort_rows=False, s
610
613
fill_value = na
611
614
warnings .warn ("read_hdf `na` argument has been renamed to `fill_value`. Please use that instead." ,
612
615
FutureWarning , stacklevel = 2 )
613
- with LHDFStore (filepath_or_buffer , ** kwargs ) as store :
616
+ with LHDFStore (filepath_or_buffer , engine = engine , ** kwargs ) as store :
614
617
res = store .get (key , fill_value = fill_value , sort_rows = sort_rows , sort_columns = sort_columns , name = name )
615
618
return res
616
619
0 commit comments