数値を含む列の.csvを科学的表記で読み取ろうとしています。 は、どんなに私が何をすべきか、それは文字列としてそれらを読み終わるん:科学的表記がパンダで文字列として読み取られています
def readData(path, cols):
types = [str, str, str, str, np.float32]
t_dict = {key: value for (key, value) in zip(c, types)}
df = pd.read_csv(path, header=0, sep=';', encoding='latin1', usecols=cols, dtype=t_dict, chunksize=5000)
return df
c = [3, 6, 7, 9, 16]
df2017_chunks = readData('Data/2017.csv', c)
def preProcess(df, f):
df.columns = f
df['id_client'] = df['id_client'].apply(lambda x: str(int(float(x))))
return df
f = ['issue_date', 'channel', 'product', 'issue', 'id_client']
df = pd.DataFrame(columns=f)
for chunk in df2017_chunks:
aux = preProcess(chunk, f)
df = pd.concat([df, aux])
にはどうすれば適切なこのデータを読み取ることができますか?
をお読みしようとしているパンダCSVの外に小さなサンプルを投稿することができますか? – cardamom