How to remove phrases in a column and let just the number?
Question:
The df it is like that:
Column A
Column B
FUNCIONARIOS
30140
BURITIS
30140
30431
30145
35481
54585
and i need that:
Column A
Column B
30140
30140
30431
30145
35481
54585
Answers:
If you take the question literally, then this will help you:
df["Column A"] = pd.to_numeric(df["Column A"], errors='coerce')
The df it is like that:
Column A | Column B |
---|---|
FUNCIONARIOS | 30140 |
BURITIS | 30140 |
30431 | 30145 |
35481 | 54585 |
and i need that:
Column A | Column B |
---|---|
30140 | |
30140 | |
30431 | 30145 |
35481 | 54585 |
If you take the question literally, then this will help you:
df["Column A"] = pd.to_numeric(df["Column A"], errors='coerce')