BUG: impossible to select string with special character from HDFStore via query · Issue #6351 · pandas-dev/pandas (original) (raw)

>>> 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"')