简体   繁体   English

如何告诉熊猫read_table一列有数值

[英]How to tell Pandas read_table a column has numerical values

This question must have been asked before or is moot. 这个问题一定是之前问过的或者是没有根据的。 However I can't find the answer. 但是我找不到答案。 Pandas read_table by default takes all the data (cells) as strings. 熊猫read_table默认情况下将所有数据(单元格)作为字符串。 How to tell it a given column (or all of them) have numerical values? 如何告诉给定的列(或所有列)具有数值?

https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_table.html https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_table.html

pandas.read_table() has a dtype= param, where you can pass a dict of {column_name: dtype_you_want_for_column} pandas.read_table()具有dtype =参数,您可以在其中传递{column_name:dtype_you_want_for_column}的字典

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

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