Dataframe.shape元组索引超出范围

时间:2018-02-13 01:55:53

标签: python-2.7 pandas dataframe

print "Boston housing dataset has {} data points with {} variables each.".format(df.shape)   

给出错误说"元组索引超出范围"

print "Boston housing dataset has {} data points with {} variables each.".format(*data.shape) 

正确输出数据框的维度。任何人都可以解释为什么会这样吗?

0 个答案:

没有答案