Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to make a column a factor in pandas

df['col_name'] = df['col_name'].astype('category')
Comment

PREVIOUS NEXT
Code Example
Python :: __new__ python 
Python :: python how to count items in array 
Python :: python count items in list 
Python :: how to redirect to previous page in django 
Python :: python aes encryption 
Python :: python loop go back to start 
Python :: flask print to console 
Python :: directory path with python argparse 
Python :: python partial 
Python :: how to run python module every 10 sec 
Python :: Python JSON API example 
Python :: django add middleware 
Python :: To visualize the correlation between any two columns | scatter plot graph 
Python :: how call module in the same directory 
Python :: tkinter button hide 
Python :: oython 
Python :: exclude last value of an array python 
Python :: python pandas column where 
Python :: python program to find ascii value of character 
Python :: python venv activate 
Python :: UTC to ISO 8601 with TimeZone information (Python 3): 
Python :: python read scv 
Python :: python code with sigma 
Python :: blender scripting set active ojbect 
Python :: python tkinter projects 
Python :: create a timestamp python 
Python :: run in thread decorator 
Python :: draw circle pygame 
Python :: add two numbers in python 
Python :: python global variable across files 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =