Fill NaN Values

NaN values are one of the most common sources of errors. Use Mito's Fill NaN values taskpane to choose how you handle your missing values.

Why fill NaN values

NaN stands for Not A Number, and is often how missing data is represented with in a dataframe. Dealing with NaN values within your analysis can effect your results in unwanted ways, and as such Mito provides an interface for filling these missing values with appropriate substitutes.

NaN values stand in for missing numbers, but there are also NaT values for Not A Timestamp for datetime and timedelta columns. Mito will allow you to replace these values as well.

How to fill NaN values

To fill NaN values:

  1. Select the Data tab.

  2. Click Fill NaN Values to open the taskpane.

  3. Select the dataframe you wish to fill nan values within.

  4. Select the columns you want to fill NaN values within.

  5. Configure the Fill Method to fill NaN values as you wish.

  6. Click the Fill NaN button to fill NaN values in these columns.

Different Fill Methods

Depending on your analysis, you may want to fill nan values different. Mito provides a few options for filling NaN values in your dataset.

  1. Values: Replaces NaN values with a specific value that you input. An input appears and allows you to input a string, number, boolean, or datetime.

  2. Forward Fill: Replaces NaN values with the value from the same column in the row before in the dataframe.

  3. Back Fill: Replaces NaN values with the value from the same column in the row after in the dataframe.

  4. Column Mean: Replaces NaN values in the column with the mean values from that column. Note that this can only be applied to number, datetime, and timedelta columns. String and boolean columns have no valid defintion of a "mean" value.

  5. Column Median: Replaces NaN values in the column with the median values from that column. Note that this can only be applied to number, datetime, and timedelta columns. String and boolean columns have no valid defintion of a "median" value.

Last updated