Write a Python program to create and display a Pandas Series as shown below:
| July | 31 |
|---|---|
| Aug | 31 |
| Sept | 30 |
| Oct | 31 |
The index labels are the names of the months – July, Aug, Sept, Oct.
The corresponding scalar values are the number of days in these respective months – 31, 31, 30, 31.
days = {'July': 31, 'Aug': 31, 'Sept': 30, 'Oct': 31} import pandas as pd
days = {'July': 31, 'Aug': 31, 'Sept': 30, 'Oct': 31}
S = pd.Series(days)
print(S) July 31
Aug 31
Sept 30
Oct 31
dtype: int64 State whether the following statement is True or False:
In Pandas Series, the Positional index can be a string or an integer.
We can add a new row to a DataFrame DF using the ______ method.
Aditya is working on a DataFrame named df. He has written the statement:
print(df.loc['S2'])What will the above statement do?
In the context of creating a Pandas Series from a dictionary, which of the following statement is correct?