Cor*_*hes 6 python dataframe pandas
head()
打印索引。
dataframe.to_string(index=False,max_rows=10)
打印前 5 行和后 5 行。
小智 7
你应该尝试这个:
print(df.head(n=10).to_string(index=False))
Run Code Online (Sandbox Code Playgroud)
这将起作用,因为df.head
返回一个Dataframe
对象,因此您可以to_string
对其应用该方法并删除该索引^^。
归档时间: |
|
查看次数: |
34303 次 |
最近记录: |