Skip to content

TST: rec arrays don't support datetimes in creation on certain platforms, related (GH6140) #6156

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

Merged
merged 2 commits into from
Jan 29, 2014
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
9 changes: 8 additions & 1 deletion pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3967,7 +3967,14 @@ def test_from_records_with_datetimes(self):

arrdata = [np.array([datetime(2005, 3, 1, 0, 0), None])]
dtypes = [('EXPIRY', '<M8[ns]')]
recarray = np.core.records.fromarrays(arrdata, dtype=dtypes)

# this may fail on certain platforms because of a numpy issue
# related GH6140
try:
recarray = np.core.records.fromarrays(arrdata, dtype=dtypes)
except (ValueError):
raise nose.SkipTest('rec arrays with datetimes not supported')

result = DataFrame.from_records(recarray)
assert_frame_equal(result,expected)

Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,19 +650,19 @@ def test_loc_setitem_frame_multiples(self):

# multiple setting
df = DataFrame({ 'A' : ['foo','bar','baz'],
'B' : range(3) })
'B' : Series(range(3),dtype=np.int64) })
df.loc[0:1] = df.loc[1:2]
expected = DataFrame({ 'A' : ['bar','baz','baz'],
'B' : [1,2,2] })
'B' : Series([1,2,2],dtype=np.int64) })
assert_frame_equal(df, expected)


# multiple setting with frame on rhs (with M8)
df = DataFrame({ 'date' : date_range('2000-01-01','2000-01-5'),
'val' : range(5) })
'val' : Series(range(5),dtype=np.int64) })
expected = DataFrame({ 'date' : [Timestamp('20000101'),Timestamp('20000102'),Timestamp('20000101'),
Timestamp('20000102'),Timestamp('20000103')],
'val' : [0,1,0,1,2] })
'val' : Series([0,1,0,1,2],dtype=np.int64) })

df.loc[2:4] = df.loc[0:2]
assert_frame_equal(df, expected)
Expand Down