1

Sorry for this newbie question. Working in Python, I need to get an integer value of the number of columns in the df and for each of them I need to get the column names.

df.printSchema() displays a nice tree view df.describe().show() displays some stats as well.

but can't seem to find a way to do get a count of columns and an array of column names. Perhaps I should do them using SQL API but am not quite familiar with it yet. Still learning basics... Thanks so much!

Jay
  • 25
  • 1
  • 1
  • 4
  • Column count: http://stackoverflow.com/questions/20297332/python-pandas-dataframe-retrieve-number-of-columns Column names: http://stackoverflow.com/questions/19482970/get-list-from-pandas-dataframe-column-headers – Eric Miller Feb 08 '17 at 18:00

0 Answers0