File size: 1,208 Bytes
0e0a1bb
 
1
2
3
{"folder": "0", "question": "Which state has the highest average PM2.5 concentration across all stations?", "answer": "Delhi", "code": "def true_code():\n    import pandas as pd\n    \n    df = pd.read_csv('data/raw_data/Data.csv', sep=\",\")\n    \n    data = df.groupby(['state','station'])['PM2.5'].mean()\n    ans = data.idxmax()[0]\n    print(ans)\n\ntrue_code()", "metadata": {"question_id": 0, "category": "spatial", "answer_category": "single", "plot": false, "libraries": ["pandas"]}}
{"folder": "1", "question": "Report the station that recorded the highest value of PM 2.5 for the month Aug of 2020", "answer": "Lal Bahadur Shastri Nagar, Kalaburagi ", "code": "def true_code():\n    import pandas as pd\n    \n    df = pd.read_csv('data/raw_data/Data.csv', sep=\",\")\n    \n    df['Timestamp'] = pd.to_datetime(df['Timestamp'])\n    \n    df['Year'] = df['Timestamp'].dt.year\n    df['Month'] = df['Timestamp'].dt.month\n    data = df[(df['Year'] == 2020) & (df['Month'] == 8)]\n    ans = data.groupby('station')['PM2.5'].max().idxmax()\n    print(ans)\n\ntrue_code()", "metadata": {"question_id": 2, "category": "temporal", "answer_category": "double", "plot": false, "libraries": ["pandas"]}}