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)
正确输出数据框的维度。任何人都可以解释为什么会这样吗?