import pandas as pd
series1 = pd.Series(['Php', 'Python', 'Java', 'C#'])
print("Original Series:")
print(series1)
result = series1.map(lambda x: len(x))
print("\nNumber of characters in each word in the said series:")
print(result)
Sample Output:
Original Series:
0 Php
1 Python
2 Java
3 C#
dtype: object
Number of characters in each word in the said series:
0 3
1 6
2 4
3 2
dtype: int64
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer