air pollution data for delhi as csv

717 views
Skip to first unread message

Debamitro Chakraborti

unread,
Dec 31, 2015, 10:58:40 AM12/31/15
to datameet
From tomorrow the Delhi govt will try an odd-even scheme for private vehicles entering the city. It might be helpful to have csv data of December and January for air pollution. CPCB does give the data in the site http://www.cpcb.gov.in/CAAQM/mapPage/frmdelhi.aspx?stateID=6 and sometimes an advance search works there as well - but I couldn't find a way of getting csv data.

Regards,
Debamitro

Sarath Guttikunda

unread,
Dec 31, 2015, 10:44:53 PM12/31/15
to data...@googlegroups.com
Dear All,

good morning.

For PM2.5, DPCC stations are more accessible than the CPCB stations

Attached is the archives from 2013, 2014, and 2015 - raw data, as archived.
The quality of the data from the airport station is not so good, a lot of weeding is required.

There are couple of other places where you can download the data for Delhi

With regards,
Sarath


--
Dr. Sarath Guttikunda
http://www.urbanemissions.info

--
Datameet is a community of Data Science enthusiasts in India. Know more about us by visiting http://datameet.org
---
You received this message because you are subscribed to the Google Groups "datameet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datameet+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Monitoring Data.rar

Nikhil VJ

unread,
Jan 1, 2016, 7:48:36 PM1/1/16
to datameet

Also check out this citizen powered air quality monitoring effort:

http://breathe.indiaspend.org/

Cheers,
Nikhil VJ
+91 966 583 1250
http://nikhilsheth.blogspot.in

shantanu oak

unread,
Jan 10, 2016, 9:28:02 AM1/10/16
to datameet
Similar data is also available from US Embassy.


Use python to read and process the data.

# import modules
%pylab inline
import pandas as pd
import numpy as np
from urllib import urlopen
import matplotlib.pyplot as plt

# open csv file from the web
tips=pd.read_csv(urlopen(url), skiprows=2, skip_footer=8, parse_dates=[['Date', 'Time']])
 
# clean up data
tips=tips.replace('NoData', np.nan)
tips=tips.fillna(method='pad')
tips = tips.ix[2:]
tips=tips.set_index(['Date_Time'])
tips['US Embassy-New Delhi'] = tips['US Embassy-New Delhi'].astype(integer)

# create charts based on first 50 rows
tips[['US Embassy-New Delhi']][:50].plot()

-- Shantanu Oak

shantanu oak

unread,
Jan 10, 2016, 11:03:34 AM1/10/16
to datameet
I am attaching a zip file abc.csv that has merged data across all 2015 csv files sent by Dr. Sarath. 

This python code was used.

import os
mylist=[]
indir = '/home/ubuntu/syllabalize_unicode/monitor/'
for root, dirs, filenames in os.walk(indir):
    for f in filenames:
        if f.endswith('csv') and f.startswith('2015'):
            mylist.append(root+f)

dflist=[]
import pandas as pd
for i in mylist:
    col_name = i.replace('_', '').split('/')[5].split('.')[0]
    i=pd.read_csv(i, parse_dates=['Date'])
    i.columns = ['sample', col_name, 'Date' ]
    i=i[[col_name, 'Date']]
    i=i.fillna(method='pad')
    i=i.set_index(['Date'])
    dflist.append(i)

merged_df=pd.concat( dflist, axis=1)
merged_df.to_csv('/var/www/html/abc.csv')

-- Shantanu Oak
abc.zip
Reply all
Reply to author
Forward
0 new messages