how to change the type of a column from int to dou...
# datascience
y
how to change the type of a column from int to double when reading the dataframe?
a
Hi! Just specify the type for a column in
colTypes
argument of
read...
function:
y
Thanks, this is neat. Also how could one use the dataschema annotation to achieve this? Any idea?
j
You can use
DataFrame.read()
first to create the dataframe using inferred types, then
.convertTo<YourDataSchemaClass>()
to auto-convert your dataframe to the data schema specified
👍 1