jekwatt / idiomatic_pandas

Tips and tricks for the most common data handling task with pandas.
0 stars 0 forks source link

Common string methods #9

Open jekwatt opened 3 years ago

jekwatt commented 3 years ago

lower, upper, title, and len

e.g.
df["col_1"].str.lower()
df["col_1"].str.upper()
df["col_1"] = df["col_1"].str.title()
df["col_1"].str.len()

To make the change, assign the field to the value: df["col_1"] = df["col_1"].str.lower()

jekwatt commented 3 years ago

Working with text data: https://pandas.pydata.org/pandas-docs/stable/user_guide/text.html