Advertisements
Advertisements
Question
Create the following series and do the specified operation:
Vowels, having 5 elements with index labels ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’ and all the five values set to zero. Check if it is an empty series.
Code Writing
Advertisements
Solution
import pandas as pd
Vowels = pd.Series([0, 0, 0, 0, 0], index=['a', 'e', 'i', 'o', 'u'])
print(Vowels)
print(Vowels.empty)
Output:
| a | 0 |
| e | 0 |
| i | 0 |
| o | 0 |
| u | 0 |
| dtype | int64 |
shaalaa.com
Is there an error in this question or solution?
