diff --git a/syscore/pandas/frequency.py b/syscore/pandas/frequency.py index 700f53b426..16c103581a 100644 --- a/syscore/pandas/frequency.py +++ b/syscore/pandas/frequency.py @@ -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) diff --git a/sysdata/mongodb/mongo_margin.py b/sysdata/mongodb/mongo_margin.py index a81cd07ebd..748f40318f 100644 --- a/sysdata/mongodb/mongo_margin.py +++ b/sysdata/mongodb/mongo_margin.py @@ -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) diff --git a/sysproduction/reporting/data/rolls.py b/sysproduction/reporting/data/rolls.py index e3343c51cd..40a6048009 100644 --- a/sysproduction/reporting/data/rolls.py +++ b/sysproduction/reporting/data/rolls.py @@ -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 diff --git a/sysquant/estimators/correlations.py b/sysquant/estimators/correlations.py index f20f7d911a..289fa0590b 100644 --- a/sysquant/estimators/correlations.py +++ b/sysquant/estimators/correlations.py @@ -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) diff --git a/systems/accounts/pandl_calculators/pandl_cash_costs.py b/systems/accounts/pandl_calculators/pandl_cash_costs.py index 0c31da1b42..46d4309db6 100644 --- a/systems/accounts/pandl_calculators/pandl_cash_costs.py +++ b/systems/accounts/pandl_calculators/pandl_cash_costs.py @@ -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()