Commit
·
66fbb5b
1
Parent(s):
32c4ccf
Update questions data
Browse files- data/questions/3/answer.txt +3 -0
- data/questions/3/code.py +26 -0
- data/questions/3/metadata.json +9 -0
- data/questions/3/question.txt +1 -0
data/questions/3/answer.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
Winter Average PM2.5: 67.4923443634478
|
2 |
+
Monsoon Average PM2.5: 34.42519611317571
|
3 |
+
Summer Average PM2.5: nan
|
data/questions/3/code.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def true_code():
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
# [Station name] = 'Lal Bahadur Shastri Nagar, Kalaburagi - KSPCB'
|
5 |
+
df = pd.read_csv('data/raw_data/Data.csv', sep=",")
|
6 |
+
|
7 |
+
df['Timestamp'] = pd.to_datetime(df['Timestamp'])
|
8 |
+
df['Year'] = df['Timestamp'].dt.year
|
9 |
+
df['Month'] = df['Timestamp'].dt.month
|
10 |
+
|
11 |
+
data = df[df['Year'] == 2018]
|
12 |
+
data = data[data['station'] == 'Lal Bahadur Shastri Nagar, Kalaburagi - KSPCB']
|
13 |
+
|
14 |
+
winter_data = data[(data['Month'] == 12) | (data['Month'] <= 2)]
|
15 |
+
summer_data = data[(data['Month'] >= 3) & (data['Month'] <= 5)]
|
16 |
+
monsoon_data = data[(data['Month'] >= 6) & (data['Month'] <= 9)]
|
17 |
+
|
18 |
+
summer_avg = summer_data['PM2.5'].mean()
|
19 |
+
winter_avg = winter_data['PM2.5'].mean()
|
20 |
+
monsoon_avg = monsoon_data['PM2.5'].mean()
|
21 |
+
|
22 |
+
print("Winter Average PM2.5:", winter_avg)
|
23 |
+
print("Monsoon Average PM2.5:", monsoon_avg)
|
24 |
+
print("Summer Average PM2.5:", summer_avg)
|
25 |
+
|
26 |
+
true_code()
|
data/questions/3/metadata.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"question_id": 3,
|
3 |
+
"category": "temporal",
|
4 |
+
"answer_category": "mutiple",
|
5 |
+
"plot": false,
|
6 |
+
"libraries": [
|
7 |
+
"pandas"
|
8 |
+
]
|
9 |
+
}
|
data/questions/3/question.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
For the year 2018, calculate the average PM2.5 concentration for each season (Winter: December-February, Summer: March-May, and Monsoon: June-September) for station [Station name]. Identify the season with the highest pollution and suggest potential factors contributing to the increase.
|