Commit 708bf508 authored by Bruno Duyé's avatar Bruno Duyé

Fix #452: some data contains 'O' instead of '0'

parent 582da5a2
Pipeline #56275 failed with stage
in 32 seconds
......@@ -221,6 +221,8 @@ def iterate_dataset(filepath):
assert time_dimension_lower in ('year', 'month', 'quarter', 'census year',
'half year'), "unexpected time dimension: {!r}".format(time_dimension_lower)
if time_dimension_lower == 'month':
# Bug #452: some data contains 'O' instead of '0'
dataframe.replace({time_dimension.label: {r'(\d{4})MO([1-9])': r'\1-M0\2'}}, regex=True, inplace=True)
# "2014M01" => "2014-01"
dataframe.replace({time_dimension.label: {r'(\d{4})[Mm](\d{2})': r'\1-\2'}}, regex=True, inplace=True)
elif time_dimension_lower == 'quarter':
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment