pd.Series(Confirmed_df["Country/Region"]).convert_objects(convert_numeric= True)
FutureWarning: convert_objects is deprecated. To re-infer data dtypes for object columns, use Series.infer_objects() For all other conversions use the data-type specific converters pd.to_datetime, pd.to_timedelta and pd.to_numeric. after removing the cwd from sys.path.
the output :
0 Afghanistan
1 Albania
2 Algeria
3 Andorra
4 Angola
5 Antigua and Barbuda
6 Argentina
7 Armenia
8 Australia
9 Australia
10 Australia
11 Australia
12 Australia
13 Australia
14 Australia
15 Australia
16 Austria
17 Azerbaijan
18 Bahamas
19 Bahrain
20 Bangladesh
21 Barbados
22 Belarus
23 Belgium
24 Benin
25 Bhutan
26 Bolivia
27 Bosnia and Herzegovin
but it is still (object) I want to convert to int type.
IICU:
df=pd.DataFrame({'Country':['Antigua and Barbuda','Argentina','Kenya']})
codes,uniques=pd.factorize(df.Country)
codes
Obviously, to convert to column
df['x']=pd.Series(codes)
df