Stack Exchange
Pandas, create a create a dataframe with converting string columns to integers
I have the following CSV file I'm importing into a Pandas DataFrame

It's not shown here but the data types are strings.
So, when I try to change the data types to integers when I'm initiating the DataFrame I get an error:

DTYPES = {
    'Money(ILS)': TypesConsts.FLOAT,
    'Money(USD) ': TypesConsts.FLOAT,
    'Total Invested(USD) ': TypesConsts.FLOAT,
    'Nominal(USD)': TypesConsts.FLOAT,
    'Realized(USD)': TypesConsts.FLOAT,
    'Years Past(Years)': TypesConsts.FLOAT,
    'Tot Time(Years)': TypesConsts.FLOAT,
    'Charges(USD)': TypesConsts.FLOAT,
    'Actual Money(USD)': TypesConsts.FLOAT,
    'VHVE(Amount)': TypesConsts.INT,
    'VHVE(Purchase)': TypesConsts.FLOAT,
    'VHVE(Per Unit)': TypesConsts.FLOAT,
    'AAPL(Amount)': TypesConsts.INT,
    'AAPL(Purchase)': TypesConsts.FLOAT,
    'AAPL(Per Unit)': TypesConsts.FLOAT,
    'Margin left(USD)': TypesConsts.FLOAT,
    'Margin added(ILS)': TypesConsts.FLOAT,
    'Gross Profit(USD)': TypesConsts.FLOAT,
    'Net. Profit(USD)': TypesConsts.FLOAT,
    'Total Charges': TypesConsts.FLOAT
}

DATES_COL = ['Date']


class OrderData:
    df = pd.read_csv(PATH,
                     dtype=DTYPES,
                     parse_dates=DATES_COL
                     )

I get the following error:
ValueError: could not convert string to float: '₪77,000.00'

I don't want to use pd.astype for every single column and after initiating the DataFrame.
So I can change the data types on the DataFrame creation?

Your error is coming because of the Unicode character, that is why it can't be converted to float. Clean your strings before you try to convert to float.

Is there a way to this in python?
since converting each cell is not realistic.
