简体   繁体   English

使用 read_csv 时 Pandas 会截断列宽

[英]Pandas truncates a column width when using read_csv

I'm trying to open a excel .csv file using pandas, and storing it in a variable.我正在尝试使用 Pandas 打开一个 excel .csv 文件,并将其存储在一个变量中。 However, it truncates one of the strings.但是,它会截断其中一个字符串。

Excel .csv file Excel .csv 文件

That's the file information, but when I check this is what i get.那是文件信息,但是当我检查时,这就是我得到的。

                            Case Owner; Resolved Date/Time;Case Origin;Case Number;Status;Subject
Reinaldo Franco;10/16/2021      3:54 PM;Chat;20546561;Resolved;General Support                   
Catalina Sanchez;10/16/2021   5:38 AM;Chat;5625033;Resolved;Support for pay... 

As you can see, it truncates where it says Support for pay..., and when I try to use to_csv() it doesn't save the entire column.如您所见,它会截断它所说的 Support for pay...,当我尝试使用 to_csv() 时,它不会保存整个列。 So I think is a problem when reading the file, but not sure.所以我认为读取文件时有问题,但不确定。

由于我需要将所有信息保存在一个单元格中而不是按列分隔,因此我能够通过使用以下命令来最大化单元格宽度来显示所有信息:pd.options.display.max_colwidth = 1000(def 为 50)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM