Locate first and last non NaN values in a Pandas DataFrame

@behzad.nouri’s solution worked perfectly to return the first and last non-NaN values using Series.first_valid_index and Series.last_valid_index, respectively.

Leave a Comment