Skip to content
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

multiple dispatch problem when comparing pandas Series against numpy scalars #14262

Closed
nmmarquez opened this issue Sep 20, 2016 · 1 comment
Closed
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request

Comments

@nmmarquez
Copy link

Code Sample, a copy-pastable example if possible

import pandas as pd
import numpy as np

# this works
pd.Series([7,8,9]) >= np.int64(8)

# this doesn't 
np.int64(8) <= pd.Series([7,8,9])

This happens with all numpy scalar types I tested

Expected Output

I would expect the output should be the same regardless of the order and that neither should fail

output of pd.show_versions()


INSTALLED VERSIONS
------------------
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 2.6.32-573.22.1.el6.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.1
nose: 1.3.4
pip: 8.1.2
setuptools: 23.0.0
Cython: 0.21
numpy: 1.10.2
scipy: 0.15.1
statsmodels: 0.6.1
xarray: None
IPython: 4.0.0
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.4
matplotlib: 1.4.3
openpyxl: 2.3.2
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: 0.5.7
lxml: 3.4.0
bs4: 4.3.2
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 0.9.7
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.32.1
pandas_datareader: None
@jreback
Copy link
Contributor

jreback commented Sep 20, 2016

this is a dupe of #13006 and fixed in 0.19.0 (0.19.0rc1 is out now)

In [1]: np.int64(8) <= pd.Series([7,8,9])
Out[1]:
0    False
1     True
2     True
dtype: bool

In [2]: pd.Series([7,8,9]) >= np.int64(8)
Out[2]:
0    False
1     True
2     True
dtype: bool

In [3]: pd.__version__
Out[3]: '0.19.0rc1+23.gdb9dc65'

@jreback jreback closed this as completed Sep 20, 2016
@jreback jreback added Bug Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request Compat pandas objects compatability with Numpy or Python functions labels Sep 20, 2016
@jreback jreback added this to the No action milestone Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions Dtype Conversions Unexpected or buggy dtype conversions Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants