I have a problem with the extraction Given is a column Date, where I want to extract the months for example: 2022-05-12 --> 05
How can I programm this?
import pandas as pd
import re
DF = pd.DataFrame({
"item_id": [1, 2, 3, 4],
"costumer": ["CG", "MD", "CC", "CZ"],
"Betrag": [150, 12, 78, 56],
"games": [["Minecraft", "Uno"], ["WOW", "Minecraft"], ["WOW", "Minecraft"], ["WOW", "Minecraft", "The last of us"]],
"date": ["2022-11-18", "2022-09-12", "2022-08-26", "2022-05-12"]
})
DF['date'] = [re.findall("(-)(-)", i) for i in DF['date']]
DF
Expected Output: each row in date: 11 09 08 05