Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. #pseudo code does not work
  2.     today = datetime.datetime.today()
  3.     try:
  4.         #convert df column to datetime column
  5.         expdate = pd.to_datetime(
  6.             df[' "Date Out of  Service"'])
  7.     except ValueError:
  8.         # quick fix to deal with the fact that some columns don't have a date.  
  9.         # This ridiculous value will be easy to tease out of finaldataset
  10.         expdate = datetime.datetime(1970, 1, 1)
  11.     df['Days til OOS'] = (expdate - today).days
  12.     return (df['Days til OOS'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement