A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/15492 below:

better message for HDFStore date query with non date columns · Issue #15492 · pandas-dev/pandas · GitHub

When querying a HDFStore with a timestamp, on a column that (in my case, inadvertently) isn't a datetime, the error message isn't helpful; I think we can trap and show something better here.

df = pd.DataFrame({'date': ['2014-01-01', '2014-01-02'], 'values': [1, 2]})

df.to_hdf('store.h5', 'df', format='t', data_columns=['date'])

ts = pd.Timestamp('2014-01-01')

In [18]: pd.read_hdf('store.h5', 'df', where='date > ts')
  File "<string>", line 1
    (date > 1970-01-01 00:00:01.388556)
                  ^
SyntaxError: invalid token

pandas 0.19.2


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4