Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
how to make a column a factor in pandas
Tushar
Programming language:
Python
2021-05-29 15:38:53
0
Q:
how to make a column a factor in pandas
THEGreatGatsby
Code:
Python
2021-06-29 13:57:20
df['col_name'] = df['col_name'].astype('category')
0
Tags
make
how
pandas
Related
pandas two conditions filter
python calculate factorial
make a condition statement on column pandas
python conditionally create new column in pandas dataframe
how to apply regex to pandas column
python pandas apply to one column
python add multiple columns to pandas dataframe
pandas dataframe print decimal places
pandas decimal places
pandas turn column to inex
pandas create a calculated column
how to add three conditions in np.where in pandas dataframe
pandas split column with tuple
how to add a column to a pandas df
New to Communities?
Join the community