Guest User

Untitled

a guest
Aug 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3.  
  4.  
  5. numAry1 = np.arange(100).reshape([20, 5])
  6. df1 = pd.DataFrame(numAry1, columns=list('abcde'))
  7. numAry2 = np.arange(100).reshape([20, 5])
  8. df2 = pd.DataFrame(numAry1, columns=list('abcde'))
  9.  
  10.  
  11.  
  12. def count(row):
  13. res = row['a'] *12
  14. return res
  15.  
  16.  
  17.  
  18. df1['z'] = df1.apply(count, axis=1)
  19. print(df1)
Add Comment
Please, Sign In to add comment