I have a column of dates in the format 2010-01-31. I can extract the year using
#extracting year
year = df["date"].values
year = [my_str.split("-")[0] for my_str in year]
df["year"] = year
I'm trying to get the month, but I don't understand how to get it on the second split.