Mito
Search…
Fill NaN 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. 1.
    Select the Columns dropdown menu.
  2. 2.
    Click Fill NaN Values to open the taskpane.
  3. 3.
    Select the dataframe you wish to fill nan values within.
  4. 4.
    Select the columns you want to fill NaN values within.
  5. 5.
    Configure the Fill Method to fill NaN values as you wish.
  6. 6.
    Click the Fill NaN button to fill NaN values in these columns.
A Mitosheet with the Fill NaN taskpane, with each step highlighted.

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. 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. 2.
    Forward Fill: Replaces NaN values with the value from the same column in the row before in the dataframe.
  3. 3.
    Back Fill: Replaces NaN values with the value from the same column in the row after in the dataframe.
  4. 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. 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.
Copy link
On this page
Why fill NaN values
How to fill NaN values