@@ -447,8 +447,8 @@ class HDFStore:
447
447
448
448
Parameters
449
449
----------
450
- path : string
451
- File path to HDF5 file
450
+ path : str
451
+ File path to HDF5 file.
452
452
mode : {'a', 'w', 'r', 'r+'}, default 'a'
453
453
454
454
``'r'``
@@ -462,18 +462,20 @@ class HDFStore:
462
462
``'r+'``
463
463
It is similar to ``'a'``, but the file must already exist.
464
464
complevel : int, 0-9, default None
465
- Specifies a compression level for data.
466
- A value of 0 or None disables compression.
465
+ Specifies a compression level for data.
466
+ A value of 0 or None disables compression.
467
467
complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib'
468
- Specifies the compression library to be used.
469
- As of v0.20.2 these additional compressors for Blosc are supported
470
- (default if no compressor specified: 'blosc:blosclz'):
471
- {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',
472
- 'blosc:zlib', 'blosc:zstd'}.
473
- Specifying a compression library which is not available issues
474
- a ValueError.
468
+ Specifies the compression library to be used.
469
+ As of v0.20.2 these additional compressors for Blosc are supported
470
+ (default if no compressor specified: 'blosc:blosclz'):
471
+ {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',
472
+ 'blosc:zlib', 'blosc:zstd'}.
473
+ Specifying a compression library which is not available issues
474
+ a ValueError.
475
475
fletcher32 : bool, default False
476
- If applying compression use the fletcher32 checksum
476
+ If applying compression use the fletcher32 checksum.
477
+ **kwargs
478
+ These parameters will be passed to the PyTables open_file method.
477
479
478
480
Examples
479
481
--------
@@ -482,6 +484,17 @@ class HDFStore:
482
484
>>> store['foo'] = bar # write to HDF5
483
485
>>> bar = store['foo'] # retrieve
484
486
>>> store.close()
487
+
488
+ **Create or load HDF5 file in-memory**
489
+
490
+ When passing the `driver` option to the PyTables open_file method through
491
+ **kwargs, the HDF5 file is loaded or created in-memory and will only be
492
+ written when closed:
493
+
494
+ >>> bar = pd.DataFrame(np.random.randn(10, 4))
495
+ >>> store = pd.HDFStore('test.h5', driver='H5FD_CORE')
496
+ >>> store['foo'] = bar
497
+ >>> store.close() # only now, data is written to disk
485
498
"""
486
499
487
500
_handle : Optional ["File" ]
@@ -634,6 +647,8 @@ def open(self, mode: str = "a", **kwargs):
634
647
----------
635
648
mode : {'a', 'w', 'r', 'r+'}, default 'a'
636
649
See HDFStore docstring or tables.open_file for info about modes
650
+ **kwargs
651
+ These parameters will be passed to the PyTables open_file method.
637
652
"""
638
653
tables = _tables ()
639
654
0 commit comments