diff --git a/measprocess/preprocess.py b/measprocess/preprocess.py index a6864f581966de4164d8488e361657aa5e12ae8a..4fa25a0761a3d08780d4b2f52a8c2ef912357301 100644 --- a/measprocess/preprocess.py +++ b/measprocess/preprocess.py @@ -6,6 +6,7 @@ from tqdm import tqdm def link_dataframes(A: pd.DataFrame, B: pd.DataFrame, ref_col: str, metric=None, verbose=True) -> (pd.DataFrame, np.ndarray): ''' Merge two DataFrames A and B according to the reference colum based on minimum metric. + Note that the final dataframe will include duplicate entries from B, while entries from A will be unique :param ref_col: Reference Column to merge dataframes. Has to exist in both frames :param metric: Metric used to determine matches in ref_col. Default lambda a, b: (a - b).abs() @@ -23,7 +24,7 @@ def link_dataframes(A: pd.DataFrame, B: pd.DataFrame, ref_col: str, metric=None, metric = lambda a, b: (a - b).abs() indices, deviations = [], [] - for _, element in tqdm(A.iterrows(), total=A.shape[0], disable=(not verbose)): + for _, element in tqdm(A.iterrows(), total=A.shape[0], disable=(not verbose), desc="Linking Dataframes"): distances = metric( element[ref_col], B[ref_col] @@ -37,7 +38,7 @@ def link_dataframes(A: pd.DataFrame, B: pd.DataFrame, ref_col: str, metric=None, ) B_with_duplicates = pd.DataFrame( - (B.iloc[index] for index in indices) + tqdm((B.iloc[index] for index in indices), total=len(indices), disable=(not verbose), desc="Building combined DataFrame") ) B_with_duplicates.columns = B.columns diff --git a/setup.py b/setup.py index 52a17690b653fff6bed1c30265f336ba299fe78a..c01dfcaae7f6d4a9081adc6e7a96073ad2f5fefa 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ README = (HERE / "README.md").read_text() # This call to setup() does all the work setup( name="measprocess", - version="0.5.9", + version="0.5.10", description="Collection of measurement processing tools", long_description=README, long_description_content_type="text/markdown",