-1

THIS IS WHAT I TRIED

weather = pd.read_csv('data/C2A2_data/BinnedCsvs_d400/fb441e62df2d58994928907a91895ec62c2c42e6cd075c2700843b89.csv')
weather.Date = pd.to_datetime(weather.Date)
weather = weather.sort_values(by = ['Date','ID']).reset_index(drop = True)

weather.set_index(weather['ID'], inplace =True)


weather.groupby('ID', as_index = True, axis = 0)

no = weather.Date.nunique()
print(weather)

I want to plot a graph for Data_Value vs Date on a particular ID and Element.

Sajan
  • 1,219
  • 1
  • 4
  • 12
Dhruv Darda
  • 103
  • 9
  • 2
    Please [provide a reproducible copy of the DataFrame with `df.head(10).to_clipboard(sep=',')`](https://stackoverflow.com/questions/52413246/how-to-provide-a-copy-of-your-dataframe-with-to-clipboard). [Stack Overflow Discourages Screenshots](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors). It is likely the question will be down-voted. You are discouraging assistance because no one wants to retype your data or code, and screenshots are often illegible. – Trenton McKinney May 23 '20 at 03:10

1 Answers1

0

I tried to retype some of your data to try and work it but it is just to difficult to properly go through it all. You really have to give all your data like what Trenton McKinney said.

You may be getting the error: ValueError: 'ID' is both an index level and a column label, which is ambiguous. I think a solution to this is at https://github.com/pandas-dev/pandas/issues/21080, but im not sure

Juicestus
  • 412
  • 7
  • 13