Wired behavior: 0 / dataframe = inf while 0.0 / dataframe = 0.0 (original) (raw)

Skip to content

Sign in

Appearance settings

View all features

View all solutions

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Sign in

Sign up

Appearance settings

pandas-dev / pandas Public

Additional navigation options

New issue

New issue

Closed

#9308

Closed

Wired behavior: 0 / dataframe = inf while 0.0 / dataframe = 0.0

#9144

#9308

Labels

BugDtype ConversionsUnexpected or buggy dtype conversions

Milestone

0.16.0

@skinnymonkey

Description

@skinnymonkey

skinnymonkey

opened

on Dec 24, 2014

In [3]: s = pd.Series([1.0, 2.0])

In [4]: 0 / s
Out[4]:
0    inf
1    inf
dtype: float64

In [5]: 0.0 / s
Out[5]:
0    0
1    0
dtype: float64

This is seems quite wired. Should not 0/s be 0 as well?

Metadata

Metadata

Assignees

No one assigned

Labels

BugDtype ConversionsUnexpected or buggy dtype conversions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions