Get dtypes from Schema #1356
-
|
Hi, My final aim is to be able to enforce pandas to use specific data types at the point of ingestion i.e.:
I would like to get the dtype from the schema model and then add a class method to the schema so that i can the do:
so far i can get the entries in the schema using:
which returns Any thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hello! Assuming you have a DataframeSchema named
|
Beta Was this translation helpful? Give feedback.
Hello! Assuming you have a DataframeSchema named
schema, then use the following dictionary comprehension for thedtypeargument:{col: dtype_pa.type for col, dtype_pa in schema.dtypes.items()}