Skip to content

Instantly share code, notes, and snippets.

@mmas
Created July 4, 2017 23:53
Show Gist options
  • Save mmas/38c249e5b818300d440986e5f1cb8d47 to your computer and use it in GitHub Desktop.
Save mmas/38c249e5b818300d440986e5f1cb8d47 to your computer and use it in GitHub Desktop.
from datetime import datetime, timedelta
import pandas as pd
source = pd.read_csv('data.csv', index_col='uuid', parse_dates=['date'])
date_1 = datetime.utcnow()
date_0 = date_1 - timedelta(days=30)
data = source[(source['date'] > date_0) & (source['date'] < date_1)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment