I have the following code in Spark-Python to get a list of names from a DataFrame schema that works fine, but how can I get a list of data types?
columnNames = df.schema.names
For example, something like:
columnTypes = df.schema.types
Is there a way to get a separate list of data types contained in a DataFrame schema?
source share