Advertisements
Advertisements
Question
Write a Python Program to create a Pandas Series as shown below using a dictionary. Note that the left column indicates the indices and the right column displays the data.
| Russia | Moscow |
| Hungary | Budapest |
| Switzerland | Bern |
Code Writing
Advertisements
Solution
import pandas as pd
data = {'Russia':'Moscow','Hungary':'Budapest','Switzerland':'Bern'}
s = pd.Series(data)
print(s)shaalaa.com
Is there an error in this question or solution?
