As the error says, you can't call an index object, which is df.toPandas().describe().columns
. Try removing the brackets:
for (col, num) in zip(df.toPandas().describe().columns, range(1,11)):
perhaps a better way is to use enumerate
instead of zip
, which avoids the need to hard code the number of columns:
for (num, col) in enumerate(df.toPandas().describe().columns):
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…