Search code examples
pythonpandastypesterminologydowncast

What does it mean to "downcast" a numeric type in pandas?


I'm seeing "downcast" used with regard to the altering of a pandas.DataFrame column-type, from float64 → float32 in this article. Now, I think I get the "down" part since 64 > 64/2, but I still don't think I get it completely.

What does "downcast" mean, specifically?

Edit: From the comments, I'm realizing this question stems from the fact I only code in python, which is dynamically-typed so I've never had to deal with this.


Solution

  • Since Python does not have a static type system, the term downcasting became free, and is now used in Pandas documentation synonymously with type coercion.