Reputation: 818
I want to append all shop dates to a new dataframe. But when I append it all values is NaN Im sure that sd has values, I've printed it and it was plenty. :)
cg = vn[vn['name'] == n]
data = pd.DataFrame(data=None, columns=cg.columns,index=cg.index)
for date in cg['date'].unique():
sd = cg[(cg['date'] == date)]
data.append(sd, ignore_index=True)
print(data)
Upvotes: 0
Views: 407
Reputation: 591
I think it should be
data = data.append(sd, ignore_index=True)
append
returns a dataframe, it's not in-place.
Upvotes: 1