使用以下代码:
predictions = pd.DataFrame([x6,x5,x4,x3,x2,x1])
print(predictions)
Run Code Online (Sandbox Code Playgroud)
在控制台打印以下内容:
0
0 782.367392
1 783.314159
2 726.904744
3 772.089101
4 728.797342
5 753.678877
Run Code Online (Sandbox Code Playgroud)
如何在predictions
没有行 (0-5) 或列 (0) 索引的情况下打印?
在 R 中,代码如下所示:
print(predictions, row.names = FALSE)
Run Code Online (Sandbox Code Playgroud)
print(df.to_string(index=False, header=False))
Run Code Online (Sandbox Code Playgroud)
print(predictions.values.tolist())
Run Code Online (Sandbox Code Playgroud)
或者
df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC'))
>>> for row in df.values: print(row)
[-1.09989127 -0.17242821 -0.87785842]
[ 0.04221375 0.58281521 -1.10061918]
[ 1.14472371 0.90159072 0.50249434]
[ 0.90085595 -0.68372786 -0.12289023]
[-0.93576943 -0.26788808 0.53035547]
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
21335 次 |
最近记录: |