Write a Pandas program to calculate the number of characters in each word in a given series
- برمجة بايثون
- 2021-09-10
- mhanasmh00489829403
الأجوبة
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
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال