KOTA ITO

Generation

generate functionWed, 07 Dec 2022

データフレームの全体の中の文字列の文字列を置換する

import pandas as pd def replace_all(df): for c in df.columns: if type(df[c][0]) is str: df[c] = df[c].str.replace('.', '').str.replace(',', '.').astype('float') return df replace_all(df)

Questions about programming?Chat with your personal AI assistant