Skip to content

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

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Dec 21, 2016

Potentially related to #10638? Otherwise, don't think this was fixed recently

['b', 'c']],
labels=[[0, 1], [0, 0], [0, 1]],
names=['testname', None, None])
expected = pd.DataFrame(np.array([[0], [1]]), index=expected_index)
Copy link
Contributor

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
----------------------------------------------------------------------

@jreback jreback added this to the 0.20.0 milestone Dec 21, 2016
example_dataframe2 = pd.DataFrame([1], index=example_multiindex2)

example_dict = {'s1': example_dataframe1, 's2': example_dataframe2}
result = pd.concat(deepcopy(example_dict), names=['testname'])
Copy link
Contributor

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

@jreback
Copy link
Contributor

jreback commented Dec 21, 2016

yeah not really sure when this was fixed, if you really want, you can git bisect to narrow it down ....

@codecov-io
Copy link

codecov-io commented Dec 22, 2016

Current coverage is 84.65% (diff: 100%)

Merging #14936 into master will increase coverage by <.01%

@@             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          

Powered by Codecov. Last update f79bc7a...55303de

@jreback jreback merged commit 35beea8 into pandas-dev:master Dec 22, 2016
@jreback
Copy link
Contributor

jreback commented Dec 22, 2016

thanks!

ShaharBental pushed a commit to ShaharBental/pandas that referenced this pull request Dec 26, 2016
@mroeschke mroeschke deleted the test_9967 branch December 20, 2017 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MultiIndex copies don't have _id field set.
3 participants