SyntaxFix
Write A Post
Hire A Developer
Questions
Use the str accessor with square brackets:
str
df['col'] = df['col'].str[:9]
Or str.slice:
df['col'] = df['col'].str.slice(0, 9)