Hi @faraz_llb, I think I might know why you’re getting these results but I’m not 100% sure. Can you please provide the data file as well? Doing so would allow others to recreate the problem and troubleshoot it more efficiently.
My best guess is that you’re getting this result because of this line of code:
which effectively deletes the contents of
year_2011 since it is a pointer to these rows. I think you can overcome this by adding on
.copy() to the end of the line of code where you define
year_2011. Specifically change to:
year_2011 = arpsci.loc[arpsci["year"] == 2011, "value"].copy()
You could also try printing the contents of
year_2011 after you delete the rows in order to test my hypothesis.
Let me know what you find out…I’m curious what is causing this!