Answers for "convert text in column to int in dataframe"

9

convert column string to int pandas

df['DataFrame Column'] = df['DataFrame Column'].astype(int)
Posted by: Guest on May-27-2020
3

convert a pandas column to int

# convert Series
my_series = pd.to_numeric(my_series)

# convert column "a" of a DataFrame
df["a"] = pd.to_numeric(df["a"])
Posted by: Guest on November-13-2020
0

python dataframe column string to integer python

my_series = pd.to_numeric(my_series)

# convert column "a" of a DataFrame
df["a"] = pd.to_numeric(df["a"])
df[[column_name]].astype(int)
Posted by: Guest on December-09-2021

Code answers related to "convert text in column to int in dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language