Series in Pandas

In this lesson, the series object of pandas is explained

Series #

Series can be described as a single column of a 2-D array or a matrix. It has specific index values attached to each row for identification. It can also be imagined as one column of an excel file.

The index values are automatically defined for each Series when it is created. These values can also be explicitly defined. Let’s look at an example to understand this:

Press + to interact
# importing pandas in our program
import pandas as pd
# Defining a series object
srs = pd.Series([1,2,3,4,5])
# printing series values
print("The Series values are:")
print(srs.values)
# printing series indexes
print("\nThe Index values are:")
print(srs.index.values)

The srs.values function on line 9 returns the values stored in the Series object and the function ...

Access this course and 1400+ top-rated courses and projects.