Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
pandas column string first n characters
MonKong
Programming language:
Python
2021-06-03 05:10:33
0
Q:
pandas column string first n characters
user43170
Code:
Python
2021-06-25 12:22:47
df1['StateInitial'] = df1['State'].str[:2] print(df1)
0
Tags
string
first
character
pandas
characters
Related
make first row column names pandas
capitalize first letter of each word python
Returns the first n rows
how to remove first letter of a string python
how to remove first letter of a string
parse first characters from string python
change to first letter capital list python
extract first letter of column python
python get first character of string
python capitalize first letter
how to capitalize the first letter in a list python
make first row columns pandas
how to capitalize first letter in python
python capitalize first letter of string without changing the rest
find first instance of character in string python
python pandas first column only
print first word of a string python and return it
New to Communities?
Join the community