Q10.webp
L

Q10.webp

Kizspy | Question: 10
(Choose 1 answer)
You have a DataFrame df:
df pd.DataFrame({
})
'Price': ['$100', '200 USD', '300.50', '$ 400.75']
Which code snippet normalizes all prices by removing the currency symbol and converting them to a float?
A. df['Price'] df['Price'].str.extract(r'(\d+\.\d+|\d+)').astype(float)
B. df['Price'] =df['Price'].str.replace(r'[S,]", ", regex=True).astype(float)
C. df['Price']=df['Price'].str.replace(r'\D", ").astype(float)
D. df['Price'] =df['Price'].str.replace(r'\D", ", regex=True).astype(float)

Thông tin

Category
DAP391m
Thêm bởi
lanphuong2005
Ngày thêm
Lượt xem
915
Lượt bình luận
4
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom