Functions, Users, and Comparative Analysis
We decided that Docs should have prime location.
Build AI products you can trust.
We’re super excited to share that Aporia is now the first ML observability offering integration to the Databricks Lakehouse Platform. This partnership means that you can now effortlessly automate your data pipelines, monitor, visualize, and explain your ML models in production. Aporia and Databricks: A Match Made in Data Heaven One key benefit of this […]
Fundamentals of ML observability
Metrics, feature importance and more
We’re excited 😁 to share that Forbes has named Aporia a Next Billion-Dollar Company. This recognition comes on the heels of our recent $25 million Series A funding and is a huge testament that Aporia’s mission and the need for trust in AI are more relevant than ever. We are very proud to be listed […]
NaN values are also called missing values and simply indicate the data we do not have. We do not like to have missing values in a dataset but it’s inevitable to have them in some cases. Therefore, we need to learn how to handle them properly.
There are different ways of handling missing values. In this how-to article, we will learn how to replace NaN values by zeros in Pandas and PySpark DataFrames.
The fillna function can be used for replacing missing values. We just need to write the value to be used as the replacement inside the function.
# Replace all missing values in the DataFrame df = df.fillna(0) # Replace missing values in a specific column df["f2"] = df["f2"].fillna(0)
We can either use fillna or na.fill function. They are aliases and return the same results.
# Replace all missing values in the DataFrame df = df.na.fill(0) # Replace missing values in a specific column df = df.na.fill(0, subset=["f2"])