I have data in the form of yyyymm in a CSV file, I want to import it into pandas and find the range of timeperiod. eg: 202201. I want to apply datetime functions to this but am unable to convert it into appropriate format.
test['YEAR_MONTH'] = pd.to_datetime(
test['YEARMONTH'], format='%Y%m', errors='coerce').dropna()
I tried using this, but to no avail.