2016-11-11から1日間の記事一覧

<Python, pandas> 文字列の置換

シリーズSeriesでの文字列置換str replace df['column'].str.replace('','')を使う。 In [52]: df = pd.DataFrame({'a':['HAGE*', 'HAGE*']}) In [53]: df.a Out[53]: 0 HAGE* 1 HAGE* Name: a, dtype: object In [54]: df.a.str.replace('\*','') Out[54]: …