Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/requirements-3.3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ xlrd==0.9.2
html5lib==1.0b2
numpy==1.8.0
cython==0.19.1
numexpr==2.1
tables==3.0.0
numexpr==2.3
tables==3.1.0
matplotlib==1.2.1
patsy==0.1.0
lxml==3.2.1
Expand Down
22 changes: 21 additions & 1 deletion pandas/io/tests/test_pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ def col(t,column):
tables.__version__ = v
self.assertRaises(Exception, store.create_table_index, 'f')

for v in ['2.3.1', '2.3.1b', '2.4dev', '2.4', original]:
for v in ['2.3.1', '2.3.1b', '2.4dev', '2.4', '3.0.0', '3.1.0', original]:
pytables._table_mod = None
pytables._table_supports_index = False
tables.__version__ = v
Expand Down Expand Up @@ -3732,6 +3732,26 @@ def test_select_as_multiple(self):
self.assertRaises(ValueError, store.select_as_multiple,
['df1','df3'], where=['A>0', 'B>0'], selector='df1')


def test_nan_selection_bug_4858(self):

# GH 4858; nan selection bug, only works for pytables >= 3.1
if LooseVersion(tables.__version__) < '3.1.0':
raise nose.SkipTest('tables version does not support fix for nan selection bug: GH 4858')

with ensure_clean_store(self.path) as store:

df = DataFrame(dict(cols = range(6), values = range(6)), dtype='float64')
df['cols'] = (df['cols']+10).apply(str)
df.iloc[0] = np.nan

expected = DataFrame(dict(cols = ['13.0','14.0','15.0'], values = [3.,4.,5.]), index=[3,4,5])

# write w/o the index on that particular column
store.append('df',df, data_columns=True,index=['cols'])
result = store.select('df',where='values>2.0')
assert_frame_equal(result,expected)

def test_start_stop(self):

with ensure_clean_store(self.path) as store:
Expand Down