dtype : Type name or dict of column -> type, optional
Data type for data or columns. E.g. {‘a’: np.float64, ‘b’: np.int32, ‘c’: ‘Int64’} Use str or object together with suitable na_values settings to preserve and not interpret dtype. If converters are specified, they will be applied INSTEAD of dtype conversion.
如果您查看文档中的^{} ,您可以使用
因此,您可以使用
pd.read_csv(..., dtype='str', ...)
,或者更精确地按列指定它相关问题 更多 >
编程相关推荐