Installing and using pandas
To use pandas you require NumPy on your system. If you are using Anaconda, then you already have Numpy and Pandas installed on it.
To import pandas library you use ‘import pandas’
We can check version of it you have ‘pandas.__version__’ under the ‘print’ statement. Then it prints the version you have installed on your system that you are going to use.
Instead of always using pandas keyword we can create object of it or we can say it as a alias, to make alias or object of pandas is- ‘import pandas as pd’. Here ‘pd’ becomes the object. As we know for NumPy — ‘import numpy as np’. Similary ‘np’ becomes the object of NumPy.
Series object in pandas
A series object in pandas is one dimensional array of data indexed. It can be created from list or arrays.
Here ‘s1’ is a series object, and output shows the sequence of values and its indices. Values are simply like a NumPy array.
Values can be accessed with its ‘values’ attribute.
We can access index of particular series with its ‘index’ attribute
Here figure shows accessing the index of particular series and shows he start index, stop index, and step of increasing position.
Series values can be accessed by associated index like python notations as shown following figure. Python series is more flexible than NumPy array