January 2019
Beginner
318 pages
8h 23m
English
The pandas series is a one-dimensional array. It can hold any data type. The labels are referred to as the index. Now, we are going to look at an example of series without declaring an index and series with declaring an index. First, we will look at an example of series without declaring an index. For that, create a script called series_without_index.py and write the following content in it:
import pandas as pdimport numpy as nps_data = pd.Series([10, 20, 30, 40], name = 'numbers')print(s_data)
Run the script and you will get the following output:
student@ubuntu:~/work$ python3 series_without_index.py
The output is as follows :
0 101 202 303 40Name: numbers, dtype: int64
In the preceding example, we learned about series without declaring ...
Read now
Unlock full access