Skip to content

Instantly share code, notes, and snippets.

@ken333135
Created June 17, 2019 07:46
Show Gist options
  • Save ken333135/1235004f58e7af296293569d2fda25da to your computer and use it in GitHub Desktop.
Save ken333135/1235004f58e7af296293569d2fda25da to your computer and use it in GitHub Desktop.
import pandas as pd
import datetime as dt
booksv2 = pd.read_csv('book1.csv')
booksv2['Start'] = booksv2['Start'].apply(lambda x: dt.datetime.strptime(str(x),'%d/%m/%Y'))
booksv2['End'] = booksv2['End'].apply(lambda x: dt.datetime.strptime(str(x),'%d/%m/%Y'))
min_date = min(list(booksv2['Start'])+list(booksv2['End']))
max_date = max(list(booksv2['Start'])+list(booksv2['End']))
#year = min_date.year
year = 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment