User Tools

Site Tools


get_the_first_non_null_value_in_each_column

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
get_the_first_non_null_value_in_each_column [2021/09/15 21:59] – [meta] rajuget_the_first_non_null_value_in_each_column [2021/09/15 22:03] (current) – [Use case] raju
Line 1: Line 1:
 ===== Get the first non null value in each column ===== ===== Get the first non null value in each column =====
 ==== Task ==== ==== Task ====
-Get the first non null value in each column+Get the first non null value in each column.
  
 Corner cases: Corner cases:
Line 72: Line 72:
 ===== Get the first value not equal to a number ===== ===== Get the first value not equal to a number =====
 ==== Use case ==== ==== Use case ====
-One downside of using np.nan to denote missing values is that an integer column of a+One downside of using np.nan to denote missing value is that an integer column of a
 dataframe gets "promoted" to a floating point column even if there is a single np.nan in it. dataframe gets "promoted" to a floating point column even if there is a single np.nan in it.
  
-work around is to use a specific integer to denote missing values. For example if we expect+One work around is to use a specific integer to denote missing value. For exampleif we expect
 all integers to be positive, we can use -9999 to denote a missing value. Let's call this all integers to be positive, we can use -9999 to denote a missing value. Let's call this
 special integer NAN_INT. special integer NAN_INT.
get_the_first_non_null_value_in_each_column.1631743178.txt.gz · Last modified: 2021/09/15 21:59 by raju