8000 BUG: Interchange object data buffer has the wrong dtype / from_dataframe incorrect by MarcoGorelli · Pull Request #55227 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: Interchange object data buffer has the wrong dtype / from_dataframe incorrect #55227

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

Merged
Prev Previous commit
Next Next commit
dont double-extract bit width
  • Loading branch information
MarcoGorelli committed Oct 10, 2023
commit 0bea19bb37420ebac63dadc6ef2da6ed1873316b
4 changes: 2 additions & 2 deletions pandas/core/interchange/from_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@ def datetime_column_to_ndarray(col: Column) -> tuple[np.ndarray | pd.Series, Any
"""
buffers = col.get_buffers()

_, _, format_str, _ = col.dtype
_, col_bit_width, format_str, _ = col.dtype
dbuf, _ = buffers["data"]
# Consider dtype being `uint` to get number of units passed since the 01.01.1970

data = buffer_to_ndarray(
dbuf,
(
DtypeKind.INT,
col.dtype[1],
col_bit_width,
getattr(ArrowCTypes, f"INT{col.dtype[1]}"),
Endianness.NATIVE,
),
Expand Down
0