Reputation: 386
I need your help:
I have dataframe d3:
i am using pivot_table
df4 = df3.pivot_table(index = ['Number','Department','Task'], columns="Date", values="Score",fill_value = 'N/A')
output d4 looks like:
why is not showing rows where Task empty is. What i am doing wrong?
I would like to create dataframe like this:
Upvotes: 3
Views: 7429
Reputation: 862741
I think here is necessary replace misisng values before pivot_table
:
cols = ['Number','Department','Task']
df[cols] = df[cols].fillna('N/A')
Upvotes: 5