Skip to content

MAINT, BUG: pandas 2.0 compatibility #912

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
merged 1 commit into from
Mar 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,12 @@ def get_heatmap_df(agg_df: pd.DataFrame, xbins: int, nprocs: int) -> pd.DataFram
bin_edge_data = np.linspace(0.0, max_time, xbins + 1)
# create dummy variables for start/end time data, where dataframe columns
# are the x-axis bin ranges
# pin dtype here because of pandas 2.0+ change--see:
# gh-909 and
# https://github.com/pandas-dev/pandas/pull/48022#issuecomment-1448755561
cats_start = pd.get_dummies(
pd.cut(agg_df["start_time"], bin_edge_data, precision=16)
pd.cut(agg_df["start_time"], bin_edge_data, precision=16),
dtype=np.uint8,
)
cats_end = pd.get_dummies(pd.cut(agg_df["end_time"], bin_edge_data, precision=16))
# get series for the elapsed times for each dxt segment
Expand Down