Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用wps的文档转换了数据类型但是在读入csv后仍旧是文本类型 #57

Open
jinxsally opened this issue Jan 16, 2024 · 2 comments

Comments

@jinxsally
Copy link

文档中的数据类型已经保存为数值型了,但是一打开notebook发现是object
不过每次保存文档的时候都提醒我该文档拥有不兼容的格式,跟这个有关系吗
图片1
图片2
图片3

@thirstylearning
Copy link

  1. 这个应该没有关系吧,文件不兼容一般是后缀格式版本不兼容,和具体的数值没有关系
  2. 如果在.xlsx文件中已经设置为数值格式,但是查看格式时为object,可能是pandas在解析时遇到问题了。被识别为object类在一些操作下效果和int32这些不太一样,可以用pandas的类型转换,看看能不能转成数值型

@cuso4lxt
Copy link

读取的时候用dtype指定列的属性为目标的数据类型的呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants