I'm trying to rename the size()
column as shown here like this:
x = monthly.copy()
x["size"] = x\
.groupby(["sub_acct_id", "clndr_yr_month"]).transform(np.size)
But what I'm getting is
ValueError: Wrong number of items passed 15, placement implies 1
Why is this not working for my dataframe?
If I simple print the copy:
x = monthly.copy()
print x
this is how the table looks like:
sub_acct_id clndr_yr_month
12716D 201601 219
201602 265
12716G 201601 221
201602 262
12716K 201601 181
201602 149
...
what I try to accomplish is to set the name of the column:
sub_acct_id clndr_yr_month size
12716D 201601 219
201602 265
12716G 201601 221
201602 262
12716K 201601 181
201602 149
...