python - python pandas读取数据框并且不包含索引
问题描述
很简单的问题
我正在用 python 阅读一个 excel 表,我想在没有自动索引 pandas 添加的情况下打印结果
import pandas as pd
x=pd.read_excel(r'2_56_01.276295.xlsx',index_col=None)
print x[:3]
这打印第一 3 行
blahblah Street Borough
0 55 W 192 ST Bronx
1 2514 EAST TREMONT AV Bronx
2 877 INTERVALE AV Bronx
但我不想要索引
解决方案
print x.to_string(index=False)
应该做的伎俩
推荐阅读
- java - Spring Boot 2.5.0、Spring Cloud 2020.0.2 和 Hibernate 5.4.31 - H2 数据库多行插入失败
- php - 在 PHP 中使用 CURL 发送文件和参数
- php - 仅为特定的重力形式运行函数
- java - 使用 ddl-auto 从 PostreSQL 获取图像时,@Transactional 不起作用:更新
- linux - NGINX 读取文件夹中新文件的自动权限
- flask - 烧瓶类型错误:“NoneType”不可下标
- python - Python 3.8:为什么即使 if 语句为 false,new_list 也会被更新?
- python - 如何在 pandas groupby 操作中计算 lambda 函数并同时添加一个 size 列?
- django - 找不到 Django 管理员和 wagtail 静态文件
- tensorboard - 如何在张量板上跟踪训练有素的张量流对象检测 api 的准确性