8. Don’t Forget about NANs - Deepstash

8. Don’t Forget about NANs

8. Don’t Forget about NANs

It’s important to remember that your datasets can always contain NANs. Unless you’ve examined your data quality and know that there are no NANs, you should pay attention to that. When we sort values, these NANs are placed behind all the other valid values, by default. If we want to change this default behavior, we set the na_position parameter.

  • We first inject one NAN into the DataFrame object.
  • When we do nothing with the na_position , the NAN value is placed at the end of the sorting group.
  • When we set “first” to na_position , the NAN value appears at the top.

5

1 read

It's time to

READ

LIKE

A PRO!

Jump-start your

reading habits

, gather your

knowledge

,

remember what you read

and stay ahead of the crowd!

It takes just 5 minutes a day.


TRY THE DEEPSTASH APP

+2M Installs

4.7 App Score