-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for use with pandas 2.1.0 * Fixes required to retain behaviors. * Changes required in light of FutureWarning concerning deprecations.
- Loading branch information
Showing
15 changed files
with
130 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1141,7 +1141,7 @@ def _set_indexes_status(self): | |
for bi in self.bis_intraday: | ||
start_session, end_session = self.limits_sessions[bi] | ||
sessions = self.cc.sessions_in_range(start_session, end_session) | ||
status = pd.Series(True, index=sessions) | ||
status = pd.Series(True, index=sessions, dtype="object") | ||
|
||
if bi.is_one_minute: | ||
# shortcut, cannot have partial indices or conflicts at T1 | ||
|
@@ -1827,7 +1827,7 @@ def _downsample_bi_table(self, df: pd.DataFrame, bi: intervals.BI) -> pd.DataFra | |
target_indices = pd.cut(bi_index.to_list(), target_index) | ||
target_indices = target_indices.remove_unused_categories() | ||
agg_f = helpers.agg_funcs(df) | ||
df = df.groupby(target_indices).agg(agg_f) | ||
df = df.groupby(target_indices, observed=False).agg(agg_f) | ||
df.index = pd.IntervalIndex(df.index) # convert from CategoricalIndex | ||
df = helpers.volume_to_na(df) | ||
df.index = pdutils.interval_index_new_tz(df.index, UTC) | ||
|
@@ -2025,8 +2025,9 @@ def _get_table_daily(self, force_ds_daily: bool = False) -> pd.DataFrame: | |
df.index = index | ||
else: # downsample for monthly | ||
pdfreq = ds_interval.as_pdfreq | ||
df = helpers.resample(df_bi, pdfreq, origin="start") | ||
df.index = pdutils.get_interval_index(df.index, pdfreq) | ||
df = df_bi.pt.downsample( | ||
This comment has been minimized.
Sorry, something went wrong.
maread99
Author
Owner
|
||
pdfreq, calendar, drop_incomplete_last_indice=False | ||
) | ||
if df.pt.first_ts < self.limits[intervals.BI_ONE_DAY][0]: | ||
# This can happen if getting all data. As the Getter's .daterange | ||
# can return start as None (at least as at April 22). Ideal would | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Can revert if pandas reverts change in behavior introduced in 2.1.0 and which it's anticipated will be reverted in 2.1.1. See pandas-dev/pandas#55064. Can remove
nominal_start
from signature (revise clients).