Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

df.fillna(-999,inplace=True)

df2.replace(-999, np.nan, inplace=True)
df2.fillna(df2.mean())

    EventId A       B        C
0   100000  0.91    124.711  2.666000
1   100001  0.91    124.711 -0.202838
2   100002  0.91    124.711 -0.202838
3   100003  0.91    124.711 -0.202838
Comment

fillna pandas inplace

When inplace = True , the data is modified in place, which means it will return nothing and the dataframe is now updated. When inplace = False , which is the default, then the operation is performed and it returns a copy of the object. You then need to save it to something.
Comment

PREVIOUS NEXT
Code Example
Python :: what is tensor in deep learning 
Python :: start virtual environment python linux 
Python :: python dictionary pop 
Python :: getsizeof python 
Python :: sort and reverse list in python 
Python :: pandas read_excel 
Python :: string acharacters count in python without using len 
Python :: Python IDLE Shell Run Command 
Python :: np ln 
Python :: tkinter frameless window 
Python :: load static 
Python :: iterate a list of tuples 
Python :: python constant 
Python :: python remove duplicates from list of dict 
Python :: up and down arrow matplotlib 
Python :: python find string count in str 
Python :: append element an array in python 
Python :: how to get all index of a char of a string in python 
Python :: python set timezone windows 
Python :: python string in list 
Python :: iterating index array python 
Python :: list comprehension python one line 
Python :: python .findall 
Python :: solidity compiler for python 
Python :: python random select no replace 
Python :: regex find email address in string python 
Python :: tensorflow metrics accuracy 
Python :: matplotlib list backend 
Python :: cosh python 
Python :: python multiply 2 variables 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =