re is from the standard library hence should be imported before numpy which should be imported before scipy (as scipy depends on numpy)