'15 0.5パーセントは」(今週出てくる)0.11.1以降のような文字列としてフォーマットパーセンテージで、置き換える値は、正規表現と交換する新しいオプションを持っているので、これが可能になります
In [14]: df = DataFrame('10.0%',index=range(100),columns=range(10))
In [15]: df.replace('%','',regex=True).astype('float')/100
Out[15]:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 100 entries, 0 to 99
Data columns (total 10 columns):
0 100 non-null values
1 100 non-null values
2 100 non-null values
3 100 non-null values
4 100 non-null values
5 100 non-null values
6 100 non-null values
7 100 non-null values
8 100 non-null values
9 100 non-null values
dtypes: float64(10)
そして受け入れ答えにコメントを答える少し速く
In [16]: %timeit df.replace('%','',regex=True).astype('float')/100
1000 loops, best of 3: 1.16 ms per loop
In [18]: %timeit df.applymap(lambda x: float(x[:-1]))/100
1000 loops, best of 3: 1.67 ms per loop
はあなたが私に教えてくださいすることができます私は、特定のためにこれを実装する方法列? .astype( 'float')/ 100'は機能しませんでした。 'df [' Column1 ']。replace('% '、' regex = True)。 – erantdo