Nov-15-2017, 07:16 PM
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:
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")