Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import numpy as np
- numAry1 = np.arange(100).reshape([20, 5])
- df1 = pd.DataFrame(numAry1, columns=list('abcde'))
- numAry2 = np.arange(100).reshape([20, 5])
- df2 = pd.DataFrame(numAry1, columns=list('abcde'))
- def count(row):
- res = row['a'] *12
- return res
- df1['z'] = df1.apply(count, axis=1)
- print(df1)
Add Comment
Please, Sign In to add comment