Skip to content

Commit 4a0b225

Browse files
fixed remaining squeeze() bugs
1 parent 2e5d9a3 commit 4a0b225

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

string_grouper/string_grouper.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def dot(self) -> pd.Series:
266266
raise Exception("To perform this function, both input Series must have the same length.")
267267
master_matrix, duplicate_matrix = self._get_tf_idf_matrices()
268268
# Calculate pairwise cosine similarities:
269-
pairwise_similarities = np.asarray(master_matrix.multiply(duplicate_matrix).sum(axis=1)).squeeze()
269+
pairwise_similarities = np.asarray(master_matrix.multiply(duplicate_matrix).sum(axis=1)).squeeze(axis=1)
270270
return pd.Series(pairwise_similarities, name='similarity', index=self._master.index)
271271

272272
@validate_is_fit
@@ -662,7 +662,7 @@ def _is_series_of_strings(series_to_test: pd.Series) -> bool:
662662
return False
663663
elif series_to_test.to_frame().applymap(
664664
lambda x: not isinstance(x, str)
665-
).squeeze().any():
665+
).squeeze(axis=1).any():
666666
return False
667667
return True
668668

0 commit comments

Comments
 (0)