Python Excel 去重
2023-09-11 14:22:27 时间
原文:https://blog.csdn.net/weixin_44266650/article/details/88416718
原文:https://www.icode9.com/content-1-230802.html
官方原文:https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html
官方原文:https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html
mark:不得不说python的这些库用着真是不要太爽。。。
代码如下
# 原文:https://blog.csdn.net/weixin_44266650/article/details/88416718
# 原文:https://www.icode9.com/content-1-230802.html
# 原文:https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html
import pandas as pd
df = pd.read_excel('test.xlsx')
print(type(df))
# inplace=True:删掉重复的行
df.drop_duplicates(['标题'], inplace=True)
# index=False:不把索引写入行
df.to_excel('out.xlsx', index=False)
print('去重完成')
去重前
去重后
相关文章
- Json schema 以及在python中的jsonschema
- Python性能分析指南(未完成)
- Python中使用第三方库xlrd来写入Excel文件示例
- 【python】正则表达式
- 【Python实战】python中含有中文字符无法运行
- 使用Python处理Excel表格的简单方法
- Python将多个excel表格合并为一个表格
- Python 日期和时间_python 当前日期时间_python日期格式化
- python类可以任意添加属性
- Python 入门(七)函数
- Python开发环境的搭建(小白适用)
- Python:更改默认启动的python程序及其对应的安装包路径(更改pip的默认安装包的路径)图文教程之详细攻略
- Python编程语言学习:python中浅复制/深复制(或浅拷贝/深拷贝)的简介、案例应用注意事项之详细攻略
- Python之tkinter:动态演示调用python库的tkinter带你进入GUI世界(Menu的Command)
- 100天精通Python(数据分析篇)——第57天:Pandas读写Excel(read_excel、to_excel参数说明+代码实战)
- 【干货】零基础转行python必学知识!
- 配电网前推后带法求电力系统潮流(Python&Matlab实现)
- python采集最新世界大学排名, 来看看你的母校上榜没~
- 牛客华为机试第8题python
- 从零开始学习python | 实例讲解如何制作Python模式程序
- 【Python成长之路】python 基础篇 -- global/nonlocal关键字使用
- 太强了,用 Python+Excel 制作天气预报表!
- 【华为机试真题 Python实现】计算矩形面积【2022 Q2 |200分】
- 两句话解释Python中if __name__ == ‘__main__‘:的作用和原理
- python 批量打开数据
- python基础===一行 Python 代码实现并行(转)
- 第五篇 python 基本语法(一)