You will need to use another library to translate Greek to English then you will convert the date from string to date type, here is a testable example:
import pandas as pd
from google_trans_new import google_translator
# set translator
translator = google_translator()
# dummy data
df = pd.DataFrame.from_dict(
{
"Time": [
"Ιανουάριος 23 2021 19:20",
"Φεβρουάριος 23 2021 19:20",
"Μάρτιος 23 2021 19:20",
"Απρίλιος 23 2021 19:20",
"Μάιος 23 2021 19:20",
"Ιούνιος 23 2021 19:20",
"Ιούλιος 23 2021 19:20",
"Αύγουστος 23 2021 19:20",
"Σεπτέμβριος 23 2021 19:20",
"Οκτώβριος 23 2021 19:20",
"Νοέμβριος 23 2021 19:20",
"Δεκέμβριος 23 2021 19:20",
]
}
)
def convert(given_date):
data = given_date.split(" ")
# convery from Greek to English
data[0] = translator.translate(data[0], lang_tgt="en")
return " ".join(data)
# convert from Greek to English using mapping in Pandas
df["Time"] = df["Time"].apply(convert)
# convert time from string to date
df["Time"] = pd.to_datetime(df["Time"], format="%B %d %Y %H:%M")
# display results
print(df["Time"].iloc[:])
Clarification
After looking into it, it seems that googletrans
library has some issues, so I am using google_trans_new
to do the translation part. [1]
[1] googletrans stopped working with error 'NoneType' object has no attribute 'group'