Skip to content

on 32bit -- Series is int64 but cut produces int32 series #14866

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

Closed
yarikoptic opened this issue Dec 12, 2016 · 6 comments
Closed

on 32bit -- Series is int64 but cut produces int32 series #14866

yarikoptic opened this issue Dec 12, 2016 · 6 comments
Labels
32bit 32-bit systems Dtype Conversions Unexpected or buggy dtype conversions Testing pandas testing functions or related to the test suite
Milestone

Comments

@yarikoptic
Copy link
Contributor

Code Sample, a copy-pastable example if possible

failing on 32bit test

    def test_single_bin(self):
        # issue 14652
        expected = Series([0, 0])

        s = Series([9., 9.])
        result = cut(s, 1, labels=False)
        tm.assert_series_equal(result, expected)

        s = Series([-9., -9.])
        result = cut(s, 1, labels=False)
        tm.assert_series_equal(result, expected)

Problem description

orig: https://buildd.debian.org/status/fetch.php?pkg=pandas&arch=i386&ver=0.19.1%2Bgit174-g81a2f79-1&stamp=1481436461 (still don't know about "bad argument to internal function" -- can't replicate locally, so ignore for this one):

======================================================================
FAIL: test_single_bin (pandas.tools.tests.test_tile.TestCut)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/tools/tests/test_tile.py", line 281, in test_single_bin
    tm.assert_series_equal(result, expected)
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 1154, in assert_series_equal
    assert_attr_equal('dtype', left, right)
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 878, in assert_attr_equal
    left_attr, right_attr)
  File "/«BUILDDIR»/pandas-0.19.1+git174-g81a2f79/debian/tmp/usr/lib/python2.7/dist-packages/pandas/util/testing.py", line 1018, in raise_assert_detail
    raise AssertionError(msg)
AssertionError: Attributes are different

Attribute "dtype" are different
[left]:  int32
[right]: int64
(Pdb) p expected
0    0
1    0
dtype: int64
(Pdb) p result
0    0
1    0
dtype: int32
(Pdb) p s
0    9.0
1    9.0
dtype: float64

so I guess if Series should use int64 regardless of underlying architecture default type, then cut should also produce int64, I guess.... or should Series have arch-default int??

@jreback
Copy link
Contributor

jreback commented Dec 12, 2016

hmm, this should always be int64. (btw this is a new tests in 0.19.2-dev)

@yarikoptic
Copy link
Contributor Author

re new tests: yeap -- trying to build current master thus version is 0.19.1+git174-g81a2f79 to correspond to 81a2f79 (count of commits 174 is off since counted since 0.19.0, since 0.19.1 was released from the release branch, so current master is not a child of it)

@jreback
Copy link
Contributor

jreback commented Dec 12, 2016

yeah for some reason our git describe is off, not really sure why

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Testing pandas testing functions or related to the test suite labels Dec 12, 2016
@jreback
Copy link
Contributor

jreback commented Dec 12, 2016

normally things like this would show up on windows, but this is ok there.

@yarikoptic
Copy link
Contributor Author

so what should we do about this one? on my end I know only asmuch as do astype in the test to workaround ;)

@jreback
Copy link
Contributor

jreback commented Dec 14, 2016

@yarikoptic if you want to debug and see where the 32bit is coming from, great. we don't test on 32-bit systems any longer.

@jreback jreback added this to the 0.20.0 milestone Jan 9, 2017
@jreback jreback added the 32bit 32-bit systems label Mar 17, 2017
jreback added a commit to jreback/pandas that referenced this issue Mar 21, 2017
jreback added a commit to jreback/pandas that referenced this issue Mar 21, 2017
mattip pushed a commit to mattip/pandas that referenced this issue Apr 3, 2017
closes pandas-dev#14866    xref pandas-dev#14183

Author: Jeff Reback <[email protected]>

Closes pandas-dev#15766 from jreback/32bit and squashes the following commits:

93c03e3 [Jeff Reback] BUG: 32bit compat for .get_indexer
4163918 [Jeff Reback] BUG: fix isin for 32bit platform issues
1bb2f60 [Jeff Reback] BUG: cut/qcut should always return int64 bins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
32bit 32-bit systems Dtype Conversions Unexpected or buggy dtype conversions Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants