I have the following dataframe:
| data |
|---|
| A(1.2,2) |
| B(1,5) |
| A(5.8, 9) |
| B(8.9,0.9) |
I would like to convert these float (str) objects to int. How do I do that?
Desired Output:
| data |
|---|
| A(1,2) |
| B(1,5) |
| A(6, 9) |
| B(9,1) |
What I tried so far?
pd.to_numeric(df['data'])
But I get the following error: ValueError: Unable to parse string "A(1,2)" at position 0 How do I solve this?