...
 
Commits (2)
......@@ -76,7 +76,7 @@ def main():
global log
global args
# Parse command line arguments
args = docopt(__doc__.format(self_filename=Path(__file__).parent))
args = docopt(__doc__.format(self_filename=Path(__file__).name))
source_dir = Path(args['<source_dir>'])
assert source_dir.exists
target_dir = Path(args['<target_dir>'])
......@@ -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':
......