I have data for 2 years and want to change each day in an automated way like :
for year in set(df.index.year):
for day in set(df[df.index.year == year].index.dayofyear):
df[df.index.year == year][df.index.dayofyear == day] = 2
The strange thing is that setting new values doesn't work at all. So I use 2 filters at once. The selection works. But changing the value doesn't work. Does someone share the same problem? Are there other ways to do so?