【发布时间】:2019-02-23 01:47:21
【问题描述】:
使用以下代码:
predictions = pd.DataFrame([x6,x5,x4,x3,x2,x1])
print(predictions)
在控制台中打印以下内容:
0
0 782.367392
1 783.314159
2 726.904744
3 772.089101
4 728.797342
5 753.678877
如何打印没有行 (0-5) 或列 (0) 索引的 predictions?
在 R 中,代码如下所示:
print(predictions, row.names = FALSE)
【问题讨论】:
-
你可以简单地使用
print(predictions.to_string(index=False)) -
@student 有正确答案
-
你成功了@student
-
而且我认为 Python 语法比 R 简单 :)
-
很好用!我没有添加答案,因为它已经回答了。
Happy Coding。 :)