ratneshpasi03's picture
Update questions data
32c4ccf
raw
history blame
1.73 kB
{"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"]}}
{"folder": "2", "question": "Which state had the most days with hazardous PM2.5 levels (above 300 µg/m³)?", "answer": "Andhra Pradesh", "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[df['PM2.5'] > 300]\n ans = data.groupby(['state', 'station']).value_counts().idxmax()[0]\n print(ans)\n\ntrue_code()", "metadata": {"question_id": 2, "category": "spatial", "answer_category": "single", "plot": false, "libraries": ["pandas"]}}