0 votes
in Python Pandas by
What are operations on Series in pandas?

1 Answer

0 votes
by

Pandas Series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.). The axis labels are collectively called index. Pandas Series is nothing but a column in an excel sheet.

Creating a Pandas Series-

In the real world, a Pandas Series will be created by loading the datasets from existing storage, storage can be SQL Database, CSV file, and Excel file. Pandas Series can be created from the lists, dictionary, and from a scalar value etc. Series can be created in different ways, here are some ways by which we create a series:

Creating a series from array: In order to create a series from array, we have to import a numpy module and have to use array() function.

# import pandas as pd

import pandas as pd

 

# import numpy as np

import numpy as np

 

# simple array

data = np.array([‘g’,’e’,’e’,’k’,’s’])

 

ser = pd.Series(data)

print(ser)

 

Related questions

0 votes
asked Aug 14, 2021 in Python Pandas by SakshiSharma
0 votes
asked Nov 9, 2021 in Python Pandas by Robin
...