question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API/BUG: Handling Dtype Coercions in Series/Index

See original GitHub issue

Off master (bd169d):

# Case I: Overflow on int64
>>> Index([np.iinfo(np.uint64).max-1],dtype='int64')
...
OverflowError: Python int too large to convert to C long

# Case II: Coercion to uint64
>>> Index([-1], dtype='uint64')
UInt64Index([18446744073709551615], dtype='uint64')

# Case III: Ignoring coercion to int
>>> Index([1, 2, 3.5], dtype=int)
Float64Index([1.0, 2.0, 3.5], dtype='float64')

So we got some coercions that fail but others that work. Although all of these issues involve Index, the first two are also applicable to Series (in the last issue, it does coerce all elements to integer).

How should we handle failed coercions? Is the second case even a failure? Should iron out this.

xref #12758 xref #15187

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ucalscommented, Mar 30, 2017

Now that we were able to close 1 novice and 2 intermediate bugs, I’d like to try an advanced bug - this one 😃

0reactions
jrebackcommented, Dec 25, 2020

sure removing xfail is good @jbrockmendel has done a lot of work on these conversions and they r likely much more sane

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found