I am trying to get a column data type from a dataframe
Here is a sample code:
print training_data.schema
print 'fields'
print training_data.schema.fields
print 'names'
print training_data.schema.names
The above code prints as shown below: StructType(List(StructField(id,LongType,true),StructField(text,StringType,true),StructField(label,DoubleType,true))) fields [StructField(id,LongType,true), StructField(text,StringType,true), StructField(label,DoubleType,true)] names ['id', 'text', 'label']
But how can I get the datatype for label column ? Thanks a lot for your time.
Regards