What does the inplace function does in drop() and dropna() functions?

0 votes
I want to know with an example about the inplace function in drop() and dropna(). Can someone explain it?
Jul 5 in Python by Dinesh

1 answer to this question.

0 votes

When inplace=True is passed, the data is renamed in place (it returns nothing), so you'd use:


When inplace=False is passed (this is the default value, so isn't necessary), performs the operation and returns a copy of the object, so you'd use:

df = df.an_operation(inplace=False) 

It simply means do not use any extra memory for replacement and replace and make changes in the existing data frame only. This is the case when inplace=true

One way is to do create a copy and make changes to the copy. This is the case when inplace=False

answered Jul 5 by Wasim

Related Questions In Python

+1 vote
1 answer

What is the difference between range and xrange functions in Python 2.X?

xrange only stores the range params and ...READ MORE

answered Aug 22, 2018 in Python by Priyaj
• 56,940 points
0 votes
1 answer

What does the random.triangular(low, high, mode) function do in python?

It returns a random floating point number ...READ MORE

answered May 27 in Python by Vinod
0 votes
1 answer

What is the difference between str() and repr() functions in Python?

str() is mostly used to create output ...READ MORE

answered Jul 8 in Python by Arvind
• 2,960 points
0 votes
1 answer

What does the dir() function do in python?

The dir() function returns all properties and methods of ...READ MORE

answered Aug 6 in Python by Mohammad
• 3,060 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 348 views
+4 votes
6 answers
0 votes
1 answer
0 votes
1 answer

Can you explain what is the use _init_ and self in python?

Hi, The basic difference between these two are _init_ ...READ MORE

answered Aug 14 in Python by anonymous