pyspark.sql.DataFrame.dtypes

property DataFrame.dtypes

Returns all column names and their data types as a list.

Examples

>>> df.dtypes
[('age', 'int'), ('name', 'string')]