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

Logical comparison operators and mathematical operators are applied inconsistently for series. #13587

Closed
RobertasA opened this issue Jul 8, 2016 · 1 comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations

Comments

@RobertasA
Copy link

RobertasA commented Jul 8, 2016

In series all logical operators are by position (iloc) while all mathematical operators are by location (loc).
This is probably similar to #4581.

e.g.
import pandas as pd
a = pd.Series([1, 4], index=[0, 1])
b = pd.Series([3, 7], index=[1, 0])

a>b

Gives

0 False
1 False
dtype: bool

But

a - b

gives

0 -6
1 1
dtype: int64

output of pd.show_versions()

`

pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Darwin
OS-release: 15.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8

pandas: 0.18.1
nose: None
pip: 1.5.6
setuptools: 3.6
Cython: None
numpy: 1.11.1
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
`

@jreback
Copy link
Contributor

jreback commented Jul 12, 2016

the description by @sinhrks on #1134 is complete description of this issue.

@jreback jreback closed this as completed Jul 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

3 participants