So i have this aggregated dataset: 
Which was made, by the following lines of code
tempo_df=df[['UserId','Steps','CampaignSource']].groupby(['Steps','UserId'],as_index=False).first()
tempo_dfs=tempo_df.groupby(['Steps']).agg(list)
As i tried to transfer the CampaignSource columns, i got a bunch of nan values. Here is the line i used
df2['CampaignSource'] = tempo_dfs['CampaignSource']
Why cant i transfer the columns CampaignSource given by my tempo_dfs, to my df2? Is there something to do to the agg method?
Here follows the end result sample: 
source https://stackoverflow.com/questions/71473176/after-aggregation-uncapable-to-add-column-to-my-other-df-pandas
Comments
Post a Comment