daily pastebin goal
37%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ID  | DEAD     | 2009-10 | ...    | 2016-10
  2.  -----------------------------------------
  3.   1   | 2018-11  | 5.4     | ...    | 6.5
  4.   2   | 2014-01  | 0.5     | ...    | 5.2
  5.   ...                      
  6.   N   | 2008-11  | 8.6     | ...    | 1.3
  7.      
  8. ID  | DEAD     | 2009-10 | ...    | 2016-10
  9.  -----------------------------------------
  10.   1   | 2018-11  | 5.4     | ...    | 6.5
  11.   2   | 2014-01  | 0.5     | ...    | NaN
  12.   ...                      
  13.   N   | 2008-11  | 8.6     | ...    | NaN
  14.      
  15. time = df.columns[2:] # take the header as an index
  16. time = pd.DataFrame(time)
  17. time.columns = ['Dummy']
  18. time['Dummy'] = pd.to_datetime(time.Dummy) # Convert index argument to datetime
  19.  
  20. df['DEAD'] = pd.to_datetime(tore.DEAD) # Convert column 'DEAD' to datetime
  21.  
  22.  
  23.  
  24. lists = []
  25. for i in range(397):
  26.     row = []
  27.     for j in range(20000):
  28.         if time.iloc[i,0] <= df.iloc[j,0]:
  29.             newlist = 1
  30.         else:
  31.             newlist = np.NaN
  32.         row.append(newlist)
  33.     lists.append(row)
  34.  
  35. lists = pd.DataFrame(lists)
  36. lists = lists.transpose()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top