How do you represent na in a Pandas DataFrame?

cbare

Does Pandas have an equivalent of R's na (meaning not available)? If not, what is the convention for representing a missing value, as opposed to NaN which represents a mathematically impossible value such as a divide by zero?

Jon Lund Steffensen

Currently there is no NA value available in Pandas or NumPy. From the section "Working with missing data" in the Pandas manual (http://pandas.pydata.org/pandas-docs/stable/missing_data.html):

The choice of using NaN internally to denote missing data was largely for simplicity and performance reasons. It differs from the MaskedArray approach of, for example, scikits.timeseries. We are hopeful that NumPy will soon be able to provide a native NA type solution (similar to R) performant enough to be used in pandas.

Also, this part of the documentation (http://pandas.pydata.org/pandas-docs/stable/gotchas.html#nan-integer-na-values-and-na-type-promotions) provides more details on the trade-offs in this choice of NA representation.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How do you calculate this type of difference in dataframe?

From Java

How do you remove the column name row when exporting a pandas DataFrame?

From Java

How do you apply a shift to a Julia Dataframe?

From Dev

How do you represent domain object behaviors using methods when a domain object is acted upon and not the actor?

From Dev

How do you shift Pandas DataFrame with a multiindex?

From Dev

Pandas Dataframe apply() method provides a row object, but how do you access the index value

From Dev

How do you represent na in a Pandas DataFrame?

From Dev

How do you stack two Pandas Dataframe columns on top of each other?

From Dev

how do you read a pytables table into a pandas dataframe

From Dev

How do you use pandas.DataFrame columns as index, columns, and values?

From Dev

How do you update the levels of a pandas MultiIndex after slicing its DataFrame?

From Dev

How do you slice a pandas dataframe as an argument in a function?

From Dev

How do you represent nested types using the Scott Encoding?

From Dev

How do you represent number with decimals greater than or equal to 2^1024 in JavaScript?

From Dev

How do you represent a text file to be edited in memory in Java

From Dev

How do you represent infinity in a JSON API?

From Dev

How do you add a calculated column to a pandas dataframe using set-based logic?

From Dev

How do you represent something as empty in Java?

From Dev

How do you represent different versions of the same entity type (class) in the same UML class diagram?

From Dev

how do you filter a Pandas dataframe by a multi-column set?

From Dev

How do you pop multiple columns off a Pandas dataframe, into a new dataframe?

From Dev

How do you fill uneven pandas dataframe column with first value in column

From Dev

How do you filter rows in a pandas dataframe conditional on columns existing?

From Dev

How do you control float formatting when using DataFrame.to_markdown in pandas?

From Dev

How do you represent different versions of the same entity type (class) in the same UML class diagram?

From Dev

PowerShell - How do you represent a unit of size as a variable

From Dev

How do you represent a container that points to several objects?

From Dev

How to represent NA in rJava

From Dev

How do you combine Range and Individual / Array Columns Selection in Pandas DataFrame

Related Related

  1. 1

    How do you calculate this type of difference in dataframe?

  2. 2

    How do you remove the column name row when exporting a pandas DataFrame?

  3. 3

    How do you apply a shift to a Julia Dataframe?

  4. 4

    How do you represent domain object behaviors using methods when a domain object is acted upon and not the actor?

  5. 5

    How do you shift Pandas DataFrame with a multiindex?

  6. 6

    Pandas Dataframe apply() method provides a row object, but how do you access the index value

  7. 7

    How do you represent na in a Pandas DataFrame?

  8. 8

    How do you stack two Pandas Dataframe columns on top of each other?

  9. 9

    how do you read a pytables table into a pandas dataframe

  10. 10

    How do you use pandas.DataFrame columns as index, columns, and values?

  11. 11

    How do you update the levels of a pandas MultiIndex after slicing its DataFrame?

  12. 12

    How do you slice a pandas dataframe as an argument in a function?

  13. 13

    How do you represent nested types using the Scott Encoding?

  14. 14

    How do you represent number with decimals greater than or equal to 2^1024 in JavaScript?

  15. 15

    How do you represent a text file to be edited in memory in Java

  16. 16

    How do you represent infinity in a JSON API?

  17. 17

    How do you add a calculated column to a pandas dataframe using set-based logic?

  18. 18

    How do you represent something as empty in Java?

  19. 19

    How do you represent different versions of the same entity type (class) in the same UML class diagram?

  20. 20

    how do you filter a Pandas dataframe by a multi-column set?

  21. 21

    How do you pop multiple columns off a Pandas dataframe, into a new dataframe?

  22. 22

    How do you fill uneven pandas dataframe column with first value in column

  23. 23

    How do you filter rows in a pandas dataframe conditional on columns existing?

  24. 24

    How do you control float formatting when using DataFrame.to_markdown in pandas?

  25. 25

    How do you represent different versions of the same entity type (class) in the same UML class diagram?

  26. 26

    PowerShell - How do you represent a unit of size as a variable

  27. 27

    How do you represent a container that points to several objects?

  28. 28

    How to represent NA in rJava

  29. 29

    How do you combine Range and Individual / Array Columns Selection in Pandas DataFrame

HotTag

Archive