Skip to content

Commit

Permalink
perf(clean): improve performance of clean_date
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonlockhart committed Feb 11, 2021
1 parent 1e3dbff commit 854329b
Show file tree
Hide file tree
Showing 13 changed files with 523 additions and 458 deletions.
22 changes: 11 additions & 11 deletions dataprep/clean/clean_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
Clean and validate a DataFrame column containing US street addresses.
"""

from operator import itemgetter
from typing import Union, Any, Tuple, List, Dict
import re
from operator import itemgetter
from typing import Any, Dict, List, Tuple, Union

import pandas as pd
import dask
import dask.dataframe as dd
import numpy as np
import dask
import pandas as pd
import usaddress

from ..eda.progress_bar import ProgressBar
from .utils import NULL_VALUES, to_dask, create_report_new
from .address_utils import (
PREFIXES,
ABBR_STATES,
FULL_PREFIX,
SUFFIXES,
FULL_STATES,
ABBR_STATES,
TAG_MAPPING,
KEYWORDS,
PREFIXES,
SUFFIXES,
TAG_MAPPING,
)
from .utils import NULL_VALUES, create_report_new, to_dask


def clean_address(
Expand Down Expand Up @@ -96,9 +96,9 @@ def clean_address(
(default: False)
errors
How to handle parsing errors.
- ‘raise’: invalid parsing will raise an exception.
- ‘coerce’: invalid parsing will be set to null.
- ‘ignore’: then invalid parsing will return the input.
- ‘ignore’: invalid parsing will return the input.
- ‘raise’: invalid parsing will raise an exception.
(default: 'coerce')
report
Expand Down
4 changes: 2 additions & 2 deletions dataprep/clean/clean_country.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def clean_country(
(default: False)
errors
How to handle parsing errors.
- ‘raise’: invalid parsing will raise an exception.
- ‘coerce’: invalid parsing will be set to null.
- ‘ignore’: then invalid parsing will return the input.
- ‘ignore’: invalid parsing will return the input.
- ‘raise’: invalid parsing will raise an exception.
(default: 'coerce')
report
Expand Down
Loading

0 comments on commit 854329b

Please sign in to comment.