# Add, subtract, multiple and divide two Pandas Series

## Add, subtract, multiple and divide two Pandas Series

Let us see how to perform basic arithmetic operations like addition, subtraction, multiplication, and division on 2 Pandas Series.

For all the 4 operations we will follow the basic algorithm :

1. Import the `Pandas `module.
2. Create 2 Pandas Series objects.
3. Perform the required arithmetic operation using the respective arithmetic operator between the 2 Series and assign the result to another Series.
4. Display the resultant Series.

 `# importing the module` `import` `pandas as pd` ` ` `# creating 2 Pandas Series` `series1 ``=` `pd.Series([``1``, ``2``, ``3``, ``4``, ``5``])` `series2 ``=` `pd.Series([``6``, ``7``, ``8``, ``9``, ``10``])` ` ` `# adding the 2 Series` `series3 ``=` `series1 ``+` `series2` ` ` `# displaying the result` `print``(series3)`

Output :

### Subtraction of 2 Series

 `# importing the module` `import` `pandas as pd` ` ` `# creating 2 Pandas Series` `series1 ``=` `pd.Series([``1``, ``2``, ``3``, ``4``, ``5``])` `series2 ``=` `pd.Series([``6``, ``7``, ``8``, ``9``, ``10``])` ` ` `# subtracting the 2 Series` `series3 ``=` `series1 ``-` `series2` ` ` `# displaying the result` `print``(series3)`

Output :

### Multiplication of 2 Series

 `# importing the module` `import` `pandas as pd` ` ` `# creating 2 Pandas Series` `series1 ``=` `pd.Series([``1``, ``2``, ``3``, ``4``, ``5``])` `series2 ``=` `pd.Series([``6``, ``7``, ``8``, ``9``, ``10``])` ` ` `# multiplying the 2 Series` `series3 ``=` `series1 ``*` `series2` ` ` `# displaying the result` `print``(series3)`

Output :

### Division of 2 Series

 `# importing the module` `import` `pandas as pd` ` ` `# creating 2 Pandas Series` `series1 ``=` `pd.Series([``1``, ``2``, ``3``, ``4``, ``5``])` `series2 ``=` `pd.Series([``6``, ``7``, ``8``, ``9``, ``10``])` ` ` `# dividing the 2 Series` `series3 ``=` `series1 ``/` `series2` ` ` `# displaying the result` `print``(series3)`

Output :

Last Updated on October 23, 2021 by admin

## Pandas dataframe.assign() – PythonPandas dataframe.assign() – Python

Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Dataframe.assign() method assign new columns to a

## Pandas – How to reset index in a given DataFramePandas – How to reset index in a given DataFrame

Pandas – How to reset index in a given DataFrame Let us see how to reset the index of a DataFrame after dropping some of the rows from the DataFrame. Approach : Import the Pandas module. Create a DataFrame. Drop

## Convert given Pandas series into a dataframe with its index as another column on the dataframeConvert given Pandas series into a dataframe with its index as another column on the dataframe

Convert given Pandas series into a dataframe with its index as another column on the dataframe First of all, let we understand that what are pandas series. Pandas Series are the type of array data structure. It is one dimensional data

## Find duplicate rows in a Dataframe [With Examples]Find duplicate rows in a Dataframe [With Examples]

When working with large datasets, it is not uncommon to encounter duplicate rows. Duplicates can cause problems when performing analysis or modeling, as they can skew results and lead to inaccurate conclusions. We will explore how to identify and remove

## Pandas – GroupBy One Column and Get Mean, Min, and Max valuesPandas – GroupBy One Column and Get Mean, Min, and Max values

Pandas – GroupBy One Column and Get Mean, Min, and Max values   We can use Groupby function to split dataframe into groups and apply different operations on it. One of them is Aggregation. Aggregation i.e. computing statistical parameters for

## Pandas DataFrame.fillna() to replace Null values in dataframePandas DataFrame.fillna() to replace Null values in dataframe

Pandas DataFrame.fillna() to replace Null values in dataframe Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, and makes importing and analyzing data much

## Data Normalization with PandasData Normalization with Pandas

Data Normalization with Pandas In this article, we will learn how to normalize data in Pandas. Let’s discuss some concepts first : Pandas: Pandas is an open-source library that’s built on top of NumPy library. it is a Python package that

## How to count unique values in a Pandas Groupby object?How to count unique values in a Pandas Groupby object?

How to count unique values in a Pandas Groupby object? Groupby as the name suggests groups attributes on the basis of similarity in some value. We can count the unique values in pandas Groupby object using groupby(), agg(), and reset_index()