- Create Series for this section
- Use name attribute to get Series name
- Use size attribute to get Series row count
- Use dtypes attribute to get Series data type
- Use describe() function to view Series Statistics
- Use the mean() function to view Series Mean
- Use the head() method to view a subset of Series data
1) Create Series for this Section
Let’s create a Series to analyze.
#import the pandas library
import pandas as pd
#create the Pandas Series include the Data, Name and index
grades = pd.Series([97,93,100,86,100,86,93,84,99],name = "history_grades",
index = ["Henry","John","Jane","Henry","John","Jane","Henry","John","Jane"])
#display grades series
grades
#PRESS Shift + Enter

2) Use name attribute to get Series name
Use the name attribute to get the name of the Series.
#get the name of the series
grades.name

3) Use size attribute to get Series row count
grades.size

4) Use dtypes attribute to get Series data type
grades.dtype

5) Use describe() function to view Series Statistics
grades.describe()

6) Use the mean() function to view Series Mean
grades.mean()

7) Use the head() method to view a subset of Series data
The head() returns the first 5 elements of your series. You can also specify another number if your want more or less .
grades.head()#returns first 5 rows
grades.head(2)#returns first 2 rows
grades.head(-5)#excludes last 5
