Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update_def(df_defaults: pd.DataFrame, df_check: pd.DataFrame, default_columns: str, checker_columns: str, time_def: str, time_check: str, rating: str):
- counter = 0
- for i in df_defaults.index:
- if df_defaults[default_columns][i] in df_check[checker_columns].values:
- temp_df = \
- df_check[df_check[checker_columns] == df_defaults[default_columns][i]].reset_index(drop=True).iloc[[0]]
- temp_df.at[0, rating] = 'D'
- temp_df.at[0, time_check] = df_defaults[time_def][i]
- # print(temp_df)
- df_check = pd.concat([df_check, temp_df], axis=0)
- counter += 1
- return df_check
- import numpy as np
- from scipy.linalg import expm
- # to weighed avg pass more than 2 elem of slice_list
- # todo ignore value outdated?
- df_migration = df[[_ro_id, slice_column, _value_column]]
- df_migration.reset_index(drop=True, inplace=True) # todo check, outdated?
- # pivot
- df_default = pd.DataFrame() #todo create df of defaults in any ways
- df_migration = update_def(df_default, df_migration, 'ogrn', _ro_id, 'time', slice_column, _value_column)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement