Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

column dataframe to int

df[[column_name]].astype(int)
Comment

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"])
Comment

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)
Comment

convert string to int dataframe column

df["col-1"] = pd.to_numeric(df["col-1"])
Comment

PREVIOUS NEXT
Code Example
Python :: how to record pyttsx3 file using python 
Python :: sort column with numeric and text data 
Python :: random word python 
Python :: tkinter gui grid and frame 
Python :: q django 
Python :: perfect number program in python 
Python :: python sorting array without inbuilt sort 
Python :: -bash: /usr/local/bin/python3: no such file or directory 
Python :: hot reloading flask 
Python :: how to pick a random number in a list python 
Python :: where to import reverse_lazy in django 
Python :: make longitude -180 to 180 
Python :: how to delete records in pandas before a certain date 
Python :: delete a row in pandas dataframe 
Python :: sqlalchemy create engine PostgreSQL 
Python :: clear all python cache 
Python :: how to play mp3 audio in python 
Python :: UnavailableInvalidChannel error in conda 
Python :: round godot 
Python :: count how many times a value shows in python list 
Python :: pyperclip copy paste 
Python :: python time in nanoseconds 
Python :: how to print variables in a string python 
Python :: python writeline file 
Python :: install django rest_framework 
Python :: sample randomforest hyperparameter tuning 
Python :: python prime check 
Python :: csv reader python skip header 
Python :: boxplot for all columns in python 
Python :: telnet python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =