Pandas Series

A 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 indexes.

The Pandas Series is nothing but a column in an Excel sheet. Labels need not be unique but must be of a hashable type.

The object supports both integer and label-based indexing and provides a host of methods for performing operations involving the index.

Pandas Series

Creating a Series

Pandas Series is created by loading the datasets from existing storage (which can be a SQL database, a CSV file, or an Excel file).

Pandas Series can be created from lists, dictionaries, scalar values, etc.

Example: Creating a series using the Pandas Library.

Python3




import pandas as pd 
import numpy as np
  
# Creating empty series 
ser = pd.Series() 
print("Pandas Series: ", ser) 
  
# simple array 
data = np.array(['g', 'e', 'e', 'k', 's']) 
    
ser = pd.Series(data) 
print("Pandas Series:\n", ser)


Output

Pandas Series: Series([], dtype: float64)
Pandas Series:
0 g
1 e
2 e
3 k
4 s
dtype: object

For more information, refer to Creating a Pandas Series

Pandas Introduction

Pandas is a powerful and open-source Python library. The Pandas library is used for data manipulation and analysis. Pandas consist of data structures and functions to perform efficient operations on data.

This free tutorial will cover an overview of Pandas, covering the fundamentals of Python Pandas.

Table of Content

  • What is Pandas Libray in Python?
  • What can you do using Pandas?
  • Getting Started with Pandas
  • Data Structures in Pandas Library
  • Pandas Series
  • Pandas DataFrame
  • How to run the Pandas Program in Python?

Similar Reads

What is Pandas Libray in Python?

Pandas is a powerful and versatile library that simplifies the tasks of data manipulation in Python....

What is Python Pandas used for?

The Pandas library is generally used for data science, but have you wondered why? This is because the Pandas library is used in conjunction with other libraries that are used for data science....

Getting Started with Pandas

Let’s see how to start working with the Python Pandas library:...

Data Structures in Pandas Library

Pandas generally provide two data structures for manipulating data. They are:...

Pandas Series

A 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 indexes....

Pandas DataFrame

...

How to run the Pandas Program in Python?

Pandas DataFrame is a two-dimensional data structure with labeled axes (rows and columns)....

Conclusion

...