Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format ignored in HDFStore.open #13291

Closed
simonkamronn opened this issue May 26, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@simonkamronn
Copy link

commented May 26, 2016

new_store = pd.HDFStore('data/test.h5', format='table')
new_store['df'] = pd.DataFrame(np.random.rand(5,1))
new_store.put('df2', pd.DataFrame(np.random.rand(5,1)), format='table')
print('df stored as table: %s' % new_store.get_storer('df').is_table)
print('df2 stored as table: %s' % new_store.get_storer('df2').is_table)

df stored as table: False
df2 stored as table: True

INSTALLED VERSIONS

commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-30-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.0

@jreback jreback added this to the Next Major Release milestone May 26, 2016

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 26, 2016

format is not a defined parameter to HDFStore; only to put/append. So I'll mark this as an issue to raise an exception if format is passed. We accept **kwargs becuase we need to pass args to the file handle open function.

In [1]: pd.HDFStore?
Init signature: pd.HDFStore(self, path, mode=None, complevel=None, complib=None, fletcher32=False, **kwargs)
Docstring:
dict-like IO interface for storing pandas objects in PyTables
either Fixed or Table format.

Parameters
----------
path : string
    File path to HDF5 file
mode : {'a', 'w', 'r', 'r+'}, default 'a'

    ``'r'``
        Read-only; no data can be modified.
    ``'w'``
        Write; a new file is created (an existing file with the same
        name would be deleted).
    ``'a'``
        Append; an existing file is opened for reading and writing,
        and if the file does not exist it is created.
    ``'r+'``
        It is similar to ``'a'``, but the file must already exist.
complevel : int, 1-9, default 0
        If a complib is specified compression will be applied
        where possible
complib : {'zlib', 'bzip2', 'lzo', 'blosc', None}, default None
        If complevel is > 0 apply compression to objects written
        in the store wherever possible
fletcher32 : bool, default False
        If applying compression use the fletcher32 checksum

Examples
--------
>>> from pandas import DataFrame
>>> from numpy.random import randn
>>> bar = DataFrame(randn(10, 4))
>>> store = HDFStore('test.h5')
>>> store['foo'] = bar   # write to HDF5
>>> bar = store['foo']   # retrieve
>>> store.close()
File:           ~/pandas/pandas/io/pytables.py
Type:           type

quintusdias added a commit to quintusdias/pandas_dev that referenced this issue May 28, 2016

@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Dec 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.