import pandas as pd
s = pd.Series([1,2,3,4,5])
# adding 5 to each value
new = s.apply(lambda num : num + 5)
# printing elements of old and new series
print(s.head().values,"
",new.head().values)
# [1 2 3 4 5]
# [6 7 8 9 10]
df = pd.DataFrame([[4, 9]] * 3, columns=['A', 'B'])
df.apply(np.sqrt)
# A B
#0 2.0 3.0
#1 2.0 3.0
#2 2.0 3.0