Issue
I am trying to restrict data plotted to that corresponding to one month in a particular year in this python 2 script. I want the user to be able to restrict the data shown to the year inputted and use the slider to restrict the month of that year. Right now, the slider works, but it is taking data from the selected month for every year, as opposed to only the year inputted. Any advice?
Solution
In short my impression is, that you try to restrict the year when defining yearr, but this is not used in the following code. If I understand your question right, the solution would be quite simple anyway:
df_2_cond = df[(df['month']==month) & (df['year']==year)]
However, this is just a guess. Please post code next time as text, not as attached screenshots and add a sample of your data, so that nobody has to sherlock holmes the structure of it. For this, text passages can easily be formatted, as you can see above.
Answered By - SpghttCd
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.