python 读取竖线分隔符的文本方法
作者:跑马的汉子_ 时间:2023-03-12 14:45:14
如下:
data = pd.read_csv('20180201.txt',sep = '|',dtype = 'str')
以上代码意思是:
1,读取本工作路径下的20180201.txt文件
2,使用'|'分割不同的列
3,所有列数据类型为字符串'str'
来源:https://blog.csdn.net/qq_34490873/article/details/81205616
标签:python,分隔符,文本
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
goland设置控制台折叠效果
2024-05-22 10:13:58
![](https://img.aspxhome.com/file/2023/6/123916_0s.png)
解决mybatis使用char类型字段查询oracle数据库时结果返回null问题
2024-01-26 03:05:05
Python如何用NumPy读取和保存点云数据
2022-05-26 17:41:19
![](https://img.aspxhome.com/file/2023/7/96917_0s.png)
Python执行外部命令subprocess的使用详解
2023-01-21 14:57:49
不到20行代码用Python做一个智能聊天机器人
2021-07-21 08:43:40
![](https://img.aspxhome.com/file/2023/4/134934_0s.jpg)
通过Python收集汇聚MySQL 表信息的实例详解
2024-01-18 17:25:20
![](https://img.aspxhome.com/file/2023/2/102782_0s.png)
Python中itertools模块用法详解
2023-05-28 05:00:27
微信小程序报错:this.setData is not a function的解决办法
2024-04-19 09:47:17
SQL Server复制功能 巧妙选择避开Bug
2011-01-04 17:03:00
如何用python批量发送工资条邮件
2021-03-07 10:53:09
![](https://img.aspxhome.com/file/2023/5/86455_0s.png)
在Python程序员面试中被问的最多的10道题
2022-02-27 08:20:03
python基础教程之面向对象的一些概念
2022-12-01 09:51:52
Matlab实现图像边缘检测
2021-02-06 07:40:58
![](https://img.aspxhome.com/file/2023/0/107200_0s.jpg)
使用python实现时间序列白噪声检验方式
2023-11-13 23:06:53
![](https://img.aspxhome.com/file/2023/9/118079_0s.jpg)
解密ThinkPHP3.1.2版本之模板继承
2023-09-06 16:02:15
浅谈Python中的异常和JSON读写数据的实现
2021-02-07 10:41:16
![](https://img.aspxhome.com/file/2023/1/135151_0s.jpg)
Python OpenCV实现传统图片格式与base64转换
2021-07-20 21:42:21
Pycharm直接使用远程服务器代码并调试的解决方法
2021-05-13 10:21:03
详解Mysql数据库平滑扩容解决高并发和大数据量问题
2024-01-19 12:52:13
![](https://img.aspxhome.com/file/2023/1/107921_0s.png)
js中Array.forEach跳出循环的方法实例
2024-05-11 09:32:22
![](https://img.aspxhome.com/file/2023/2/126172_0s.png)