Advertisements
Advertisements
Question
Using the series created in Question 5, write commands for the following:
- Find the dimensions, size and values of the Series EngAlph, Vowels, Friends, MTseries, MonthDays.
- Rename the Series MTseries as SeriesEmpty.
- Name the index of the Series MonthDays as monthno and that of Series Friends as Fname.
- Display the 3rd and 2nd value of the Series Friends, in that order.
- Display the alphabets ‘e’ to ‘p’ from the Series EngAlph.
- Display the first 10 values in the Series EngAlph.
- Display the last 10 values in the Series EngAlph.
- Display the MTseries.
Code Writing
Advertisements
Solution
print(EngAlph.shape, EngAlph.size, EngAlph.values)
print(Vowels.shape, Vowels.size, Vowels.values)
print(Friends.shape, Friends.size, Friends.values)
print(MTseries.shape, MTseries.size, MTseries.values)
print(MonthDays.shape, MonthDays.size, MonthDays.values)
SeriesEmpty = MTseries
print(SeriesEmpty)
MonthDays.index.name = 'monthno'
Friends.index.name = 'Fname'
print(Friends.iloc[2])
print(Friends.iloc[1])
print(EngAlph[4:16])
print(EngAlph.head(10))
print(EngAlph.tail(10))
print(MTseries)shaalaa.com
Is there an error in this question or solution?
