-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST: Concat MultiIndex dataframes with deepcopy (#9967) #14936
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
Conversation
['b', 'c']], | ||
labels=[[0, 1], [0, 0], [0, 1]], | ||
names=['testname', None, None]) | ||
expected = pd.DataFrame(np.array([[0], [1]]), index=expected_index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on windows, np.array([[0], [1]])
is int32
, so pass a dtype='int64'
here on the expected, or
just use [[0], [1]]
which always returns int64
======================================================================
FAIL: test_concat_multiindex_dfs_with_deepcopy (pandas.tools.tests.test_concat.TestConcatenate)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Python27_64\envs\pandas\lib\site-packages\pandas\tools\tests\test_concat.py", line 2171, in test_concat_multiindex_dfs_with_deepcopy
tm.assert_frame_equal(result, expected)
File "C:\Python27_64\envs\pandas\lib\site-packages\pandas\util\testing.py", line 1313, in assert_frame_equal
obj='DataFrame.iloc[:, {0}]'.format(i))
File "C:\Python27_64\envs\pandas\lib\site-packages\pandas\util\testing.py", line 1154, in assert_series_equal
assert_attr_equal('dtype', left, right)
File "C:\Python27_64\envs\pandas\lib\site-packages\pandas\util\testing.py", line 878, in assert_attr_equal
left_attr, right_attr)
File "C:\Python27_64\envs\pandas\lib\site-packages\pandas\util\testing.py", line 1018, in raise_assert_detail
raise AssertionError(msg)
AssertionError: Attributes are different
Attribute "dtype" are different
[left]: int64
[right]: int32
----------------------------------------------------------------------
example_dataframe2 = pd.DataFrame([1], index=example_multiindex2) | ||
|
||
example_dict = {'s1': example_dataframe1, 's2': example_dataframe2} | ||
result = pd.concat(deepcopy(example_dict), names=['testname']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also do this w/o the deepcopy
yeah not really sure when this was fixed, if you really want, you can |
Add additional test + fix int32 error
Current coverage is 84.65% (diff: 100%)@@ master #14936 diff @@
==========================================
Files 144 144
Lines 51021 51021
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43188 43191 +3
+ Misses 7833 7830 -3
Partials 0 0
|
thanks! |
…ndas-dev#14936) Add additional test + fix int32 error
git diff upstream/master | flake8 --diff
Potentially related to #10638? Otherwise, don't think this was fixed recently