Skip to content
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

fix pandas future warnings #1464

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion syscore/pandas/frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def merge_data_with_different_freq(
dtype: int64
"""

list_as_concat_pd = pd.concat(list_of_data, axis=0)
list_as_concat_pd = pd.concat(list_of_data, axis=0) # TODO 1463
sorted_pd = list_as_concat_pd.sort_index()
unique_pd = uniquets(sorted_pd)

Expand Down
4 changes: 3 additions & 1 deletion sysdata/mongodb/mongo_margin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ def from_dict_of_entries_to_margin_series(dict_of_entries: dict) -> seriesOfMarg
]
list_of_values = list(dict_of_entries.values())

pd_series = pd.Series(list_of_values, index=list_of_keys_as_datetime)
pd_series = pd.Series(
list_of_values, index=list_of_keys_as_datetime, dtype="float64"
)
pd_series = pd_series.sort_index()

return seriesOfMargin(pd_series)
Expand Down
6 changes: 5 additions & 1 deletion sysproduction/reporting/data/rolls.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,11 @@ def last_price_data_with_matched_contracts(df_of_col_and_col_to_use):
row_to_copy = df_of_col_and_col_to_use[
["Price_to_find", "Price_infer_from"]
].iloc[data_row_idx]
matched_df_dict = matched_df_dict.append(row_to_copy)

if matched_df_dict.empty:
matched_df_dict = row_to_copy
else:
matched_df_dict = pd.concat([matched_df_dict, row_to_copy])
else:
# We're full
break
Expand Down
2 changes: 2 additions & 0 deletions sysquant/estimators/correlations.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,13 @@ def add_assets_with_nan_values(self, new_asset_names):
[[np.nan] * len(new_asset_names)] * len(new_asset_names),
columns=new_asset_names,
index=new_asset_names,
dtype="float64",
)
l2 = pd.DataFrame(
[[np.nan] * len(self.columns)] * len(new_asset_names),
columns=self.columns,
index=new_asset_names,
dtype="float64",
)
bottom_row = pd.concat([l2, r2], axis=1)
both_rows = pd.concat([top_row, bottom_row], axis=0)
Expand Down
4 changes: 3 additions & 1 deletion systems/accounts/pandl_calculators/pandl_cash_costs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def costs_from_trading_in_instrument_currency_as_series(self) -> pd.Series:
self.costs_from_trading_in_instrument_currency_as_list()
)
date_index = self.date_index_for_all_fills()
costs_as_pd_series = pd.Series(instrument_currency_costs_as_list, date_index)
costs_as_pd_series = pd.Series(
instrument_currency_costs_as_list, date_index, dtype="float64"
)
costs_as_pd_series = costs_as_pd_series.sort_index()
costs_as_pd_series = costs_as_pd_series.groupby(costs_as_pd_series.index).sum()

Expand Down