Created
June 27, 2022 18:40
-
-
Save sjster/f5a51f19bf818d540327ac7b0f8f5769 to your computer and use it in GitHub Desktop.
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
def read_inputs_join(ev: pd.DataFrame, tu: pd.DataFrame, df_target: pd.DataFrame) -> pd.DataFrame: | |
print(ev.head()) | |
print(tu.head()) | |
ev.set_index('IDENTITY_ID', inplace=True) | |
tu.set_index('IDENTITY_ID', inplace=True) | |
df_target.set_index('IDENTITY_ID', inplace=True) | |
log = logging.getLogger(__name__) | |
log.info(f"Length of ev is {len(ev)}") | |
log.info(f"Length of tu is {len(tu)}") | |
log.info(f"Length of target is {len(df_target)}") | |
df_joined = ev.join(tu, how='inner') | |
df_ev_tu_target = df_target.join(df_joined, how='inner') | |
print("Target type is ",type(df_ev_tu_target)) | |
log.info(f"Length of target joined with es_tu is {len(df_ev_tu_target)}") | |
return(df_ev_tu_target) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment