got the following code
import pandas as pd
import numpy as np
df1=pd.read_excel('FA9th june.xlsx')
df1.head()
Days Amount Repayments Balance
40.0 19 500.00 15 000.00 4 500.00
40.0 19 500.00 0 19 500.00
40.0 9 750.00 2 670.00 7 080.00
40.0 32 500.00 11 500.00 21 000.00
40.0 3 250.00 580 2 670.00
I want my data to be without them spaces in between number and without the decimal places, looking like this:
Days Amount Repayments Balance
40 19500 15000 4500
40 19500 0 19500
40 9750 2670 7080
40 32500 11500 21000
40 3250 580 2670
I tried converting it to int but it kept returning this error:
invalid literal for int() with base 10: '19 500.00'
whenever I run this code:
df1['Amount'] = pd.to_numeric(X['Amount'], errors='ignore').astype(int)