Skip to content

BUG: impossible to select string with special character from HDFStore via query #6351

Closed
@jreback

Description

@jreback

http://stackoverflow.com/questions/21769406/pandas-and-hdf5-querying-a-table-string-containing-character

>>> from pandas import HDFStore, DataFrame
>>> df = DataFrame({'a': ['a', 'a', 'c', 'b', 'test & test', 'c' , 'b', 'e'], 
                   'b': [1, 2, 3, 4, 5, 6, 7, 8]})
>>> store = HDFStore('test.h5')
>>> store.append('test', df, format='table', data_columns=True)
>>> df[df.a == 'test & test']
     a              b
4    test & test    5
>>> store.select('test', 'a="test & test"')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions