English

Using the series created in Question 5, write commands for the following: a) Find the dimensions, size and values of the Series EngAlph, Vowels, Friends, MTseries, MonthDays.

Advertisements
Advertisements

Question

Using the series created in Question 5, write commands for the following:

  1. Find the dimensions, size and values of the Series EngAlph, Vowels, Friends, MTseries, MonthDays.
  2. Rename the Series MTseries as SeriesEmpty.
  3. Name the index of the Series MonthDays as monthno and that of Series Friends as Fname.
  4. Display the 3rd and 2nd value of the Series Friends, in that order.
  5. Display the alphabets ‘e’ to ‘p’ from the Series EngAlph.
  6. Display the first 10 values in the Series EngAlph.
  7. Display the last 10 values in the Series EngAlph.
  8. 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?
Chapter 2: Data Handling using Pandas - I - Exercise [Page 60]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 2 Data Handling using Pandas - I
Exercise | Q 7. | Page 60
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×