我有一个包含多个列的数据帧,如下所示 SE# Name Industry Code Industry
12345 Tom Jerry 923 Travel SE#为int64,行业代码为int64,其余为对象。我用过 df.astype(str) 数据类型列更改为对象,但当我将文件另存为csv,然后读回该文件时,数据类型重置为int64。请建议如何确保数据类型保持为对象 最终目标是将CS
我试图使用type: object将列的数据类型从type: int64更改为DataFrame中的.map()。return None return None
print("Not int64但是,当我在完成后检查数据类型时,它将恢复为type: float。
print("%s is a %s after converting
例如: array[1] # of course in reality this number is dynamic 其中,数组的数据类型为: Record(Date[type=int64;offset如果我尝试通过列名进行访问,它会起作用: array['Date'] # <== This is just fine 因此,我尝试创建一个简单的函数来将索引转换为列名(必须返回一个ascii代码数组,我想,如果我可以将unit8数组转换为字符串,并使用该字符串