Advertisements
Advertisements
प्रश्न
Write a Python program to create a Pandas Series as shown below from an ndarray containing the numbers 10, 20, 30, 40, 50 with corresponding indices ‘A’, ‘B’, ‘C’, ‘D’, ‘E’.
A |
10 |
B |
20 |
C |
30 |
D |
40 |
E |
50 |
कोड लेखन
Advertisements
उत्तर
import pandas as pd
import numpy as np
data = np.array([10, 20, 30, 40, 50])
indices = ['A', 'B', 'C', 'D', 'E']
series = pd.Series(data, index=indices)
print(series)shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
