Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pseudo code does not work
- today = datetime.datetime.today()
- try:
- #convert df column to datetime column
- expdate = pd.to_datetime(
- df[' "Date Out of Service"'])
- except ValueError:
- # quick fix to deal with the fact that some columns don't have a date.
- # This ridiculous value will be easy to tease out of finaldataset
- expdate = datetime.datetime(1970, 1, 1)
- df['Days til OOS'] = (expdate - today).days
- return (df['Days til OOS'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement