How to convert (%) sign in float data type or delete it

81 Views Asked by At

When I try to read the date from Excel file, I found that the column called "TOT_SALES" the data type is float64 and all values with % sign. I want to remove this sign and dividing all values on 100. And at the same time the values in the column in Excel file are regular as I mentioned.

any help how to remove the (%) from the values.

df= pd.read_excel("QVI_transaction_data_1.xlsx")

df.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 264836 entries, 0 to 264835
Data columns (total 8 columns):
 #   Column          Non-Null Count   Dtype         
---  ------          --------------   -----         
 0   DATE            264836 non-null  datetime64[ns]
 1   STORE_NBR       264836 non-null  int64         
 2   LYLTY_CARD_NBR  264836 non-null  int64         
 3   TXN_ID          264836 non-null  int64         
 4   PROD_NBR        264836 non-null  int64         
 5   PROD_NAME       264836 non-null  object        
 6   PROD_QTY        264836 non-null  int64         
 7   TOT_SALES       264836 non-null  float64       
dtypes: datetime64[ns](1), float64(1), int64(5), object(1)
memory usage: 16.2+ MB


df.head()

this is the result appear in the DataFrame 

TOT_SALES
1180.00%
740.00%
420.00%
1080.00%
660.00%

This is the values in the Excel file without (%) sign

TOT_SALES
11.80
7.40
4.20
10.80
6.60

enter image description here

enter image description here

enter image description here

0

There are 0 best solutions below