-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Preserve input start
/end
type in interval_range
#57268
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
Labels
Comments
In the interval.py, I made it retain the same datatype if both start and end has same datatype dtype = start.dtype if start.dtype == end.dtype else np.dtype("int64")
breaks = maybe_downcast_numeric(
breaks, # type: ignore[arg-type]
dtype,
)
return IntervalIndex.from_breaks(breaks, name=name, closed=closed, dtype=IntervalDtype(subtype=dtype, closed=closed)) And I am getting the desired results |
VISWESWARAN1998
added a commit
to VISWESWARAN1998/pandas
that referenced
this issue
Feb 13, 2024
VISWESWARAN1998
added a commit
to VISWESWARAN1998/pandas
that referenced
this issue
Feb 13, 2024
…n interval_range
5 tasks
VISWESWARAN1998
added a commit
to VISWESWARAN1998/pandas
that referenced
this issue
Feb 13, 2024
VISWESWARAN1998
added a commit
to VISWESWARAN1998/pandas
that referenced
this issue
Feb 13, 2024
mroeschke
added a commit
that referenced
this issue
Feb 15, 2024
#57399) * Fix for issue #57268 - ENH: Preserve input start/end type in interval_range * issue #57268 - github actions resolution * Use generated datatype from breaks * Ruff - Pre-commit issue fix * Fix for issue #57268 - floating point support * int - float dtype compatability * whatsnew documentation update * OS based varaible access * Fixing failed unit test cases * pytest - interval passsed * Python backwards compatability * Pytest * Fixing PyLint and mypy issues * dtype specification * Conditional statement simplification * remove redundant code blocks * Changing whatsnew to interval section * Passing expected in parameterize * Update doc/source/whatsnew/v3.0.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update pandas/core/indexes/interval.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
pmhatre1
pushed a commit
to pmhatre1/pandas-pmhatre1
that referenced
this issue
May 7, 2024
…n interval… (pandas-dev#57399) * Fix for issue pandas-dev#57268 - ENH: Preserve input start/end type in interval_range * issue pandas-dev#57268 - github actions resolution * Use generated datatype from breaks * Ruff - Pre-commit issue fix * Fix for issue pandas-dev#57268 - floating point support * int - float dtype compatability * whatsnew documentation update * OS based varaible access * Fixing failed unit test cases * pytest - interval passsed * Python backwards compatability * Pytest * Fixing PyLint and mypy issues * dtype specification * Conditional statement simplification * remove redundant code blocks * Changing whatsnew to interval section * Passing expected in parameterize * Update doc/source/whatsnew/v3.0.0.rst Co-authored-by: Matthew Roeschke <[email protected]> * Update pandas/core/indexes/interval.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
3 tasks
rapids-bot bot
pushed a commit
to rapidsai/cudf
that referenced
this issue
Jan 29, 2025
Towards #17843 Needed to change some `interval_range` test to account for pandas-dev/pandas#57268 Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - Matthew Murray (https://github.com/Matt711) URL: #17844
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
It would be ideal if the resulting dtype was
'interval[int8, right]'
The text was updated successfully, but these errors were encountered: