How can I get from 'pyspark.sql.types.Row' all the columns/attributes name? How can I get from 'pyspark.sql.types.Row' all the columns/attributes name? python python

How can I get from 'pyspark.sql.types.Row' all the columns/attributes name?


If you don't care about the order you can simply extract these from a dict:

list(row_info.asDict())

otherwise the only option I am aware of is using __fields__ directly:

row_info.__fields__