I have an Excel file with the headings: Date, AQI and Raw Conc. The date is in yyyy-mm-dd format. I want to extract the data between two dates and copy it to another Excel file via Python.
What I have tried:
What I have tried:
1 2 3 4 5 6 7 8 9 10 11 |
import pandas as pd from pandas import DataFrame import datetime import pandas.io.data df = pd.read_csv(r "C:\Users\Win-8.1\Desktop\delhi\dated.csv" , index_col = 'Date' , parse_dates = True ) mask = (df[ 'Date' ] > = '09-01-2015' ) & (df[ 'Date' ] < = '11-30-2016' ) mask.to_csv(r "C:\Users\Win-8.1\Desktop\delhi\extracted.csv" ) |