I have a csv data set want to convert the text to numeric , are their any function can used or using excel function ?
I tried to convert the data frame using
pd.to_numeric(x,errors='coerce'.isnull())
and that not work also a tried to use data['MainCategory'] = data['MainCategory'].astype(float)
Asked
Active
Viewed 208 times
-2

Batool kayed
- 1
- 1
-
1what kind of text? like '2' or 'two'? – 1__ Nov 07 '19 at 21:45
-
@YusufBaktir "tow" – Batool kayed Nov 07 '19 at 21:52
-
1In this platform it is appreciated if you frame your question to be informative enough, as well as show our efforts towards solving it i.e. things you tried but did not work. – Anakin Nov 07 '19 at 21:59
1 Answers
0
In python:
yourString = float(yourString)
In VBA:
yourString = CDbl(yourString)
if you're trying to convert "two" to the int 2 there is a good example here: Is there a way to convert number words to Integers?

Wilco
- 374
- 1
- 11