Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Replace the string with NAN value

data['horsepower'].replace(to_replace='?' , value = np.nan,inplace = True)
data['horsepower'].unique()
Comment

pandas replace nan with mean

--fillna
product_mean = df['product'].mean()
df['product'] = df['product'].fillna(product_mean)

--replace method
col_mean = np.mean(df['col'])
df['col'] = df['col'].replace(np.nan, col_mean)
Comment

replace nan

df['salary'] = df['salary'].fillna(df['salary'].mode()[0])
Comment

Replace NaN value by mean of all column

data.loc[data['taille'].isnull(), 'taille'] = data['taille'].mean()
Comment

PREVIOUS NEXT
Code Example
Python :: instagram private account hacking code python 
Python :: setting a condition for perfect square in python 
Python :: strip unicode characters from strings python 
Python :: breaking big csv into chunks pandas 
Python :: scientific notation matplotlib python 
Python :: isinstance float or int 
Python :: flask_mail 
Python :: os listdir sort by date 
Python :: selenium get back from iframe python 
Python :: move mouse round in python 
Python :: pathlib current directory 
Python :: is vowel python 
Python :: how to make rich presence discord,py 
Python :: what is cleaned data in django 
Python :: icon tkiner 
Python :: list of files to zip python 
Python :: scikit learn k means 
Python :: encrypt string python 
Python :: how to veiw and edit files with python 
Python :: python find specific file in directory 
Python :: implicit conversion in python example 
Python :: how to extract numbers from a list in python 
Python :: python zip extract directory 
Python :: Import CSV Files into R Using fread() method 
Python :: Flatten List in Python Using List Comprehension 
Python :: charcodeat python 
Python :: Write a python program to find the most frequent word in text file 
Python :: django rest 
Python :: python list iterate in 1 line 
Python :: python set remove 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =