VOOZH about

URL: https://www.geeksforgeeks.org/python/what-does-inplace-mean-in-pandas/

⇱ What does inplace mean in Pandas? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

What does inplace mean in Pandas?

Last Updated : 23 Jul, 2025

In this article, we will see Inplace in pandas. Inplace is an argument used in different functions. Some functions in which inplace is used as an attributes like, set_index(), dropna(), fillna(), reset_index(), drop(), replace() and many more. The default value of this attribute is False and it returns the copy of the object.

Here we are using fillna() methods.

Syntax: dataframe.fillna(dataframe.mean(), inplace = False) 
 

Let's understand this method with step-wise implementation:

Step 1. First, we import all the required libraries.

Step 2.Creating dataframe.

  Output : 

👁 Image

Step 3.To see the inplace use we are going to use the rename function where we are renaming "Name" Column to "FirstName". 

 In this step, We will not use inplace in our code.

Output :

👁 Image

We can clearly see that there are no changes in the original dataframe. Through this, we conclude that the default value of inplace is False.

Now in this step, we will use inplace with False value.

Output :  

👁 Image

Again we can clearly see that there are no changes in the original dataset.

At last, we are putting inplace value equal to True.      

Output :

👁 Image

Finally, we can see that the original dataframe columns have been modified from "Name" to "FirstName".

Below is the complete program based on the above approach :

Output : 

👁 Image

Comment
Article Tags:
Article Tags: