Skip to content

Commit d422dce

Browse files
committed
change errors="coerce" to errors="raise" in pd.to_numeric calls
1 parent 313326d commit d422dce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doubleml/data/base_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,9 @@ def _set_attr(col):
703703
if col is None:
704704
return None
705705
if isinstance(col, list):
706-
converted_data = self.data.loc[:, col].apply(pd.to_numeric, errors="coerce")
706+
converted_data = self.data.loc[:, col].apply(pd.to_numeric, errors="raise")
707707
else:
708-
converted_data = pd.to_numeric(self.data.loc[:, col], errors="coerce")
708+
converted_data = pd.to_numeric(self.data.loc[:, col], errors="raise")
709709
assert_all_finite(converted_data)
710710
return converted_data
711711

@@ -750,7 +750,7 @@ def set_x_d(self, treatment_var):
750750
if pd.api.types.is_datetime64_any_dtype(treatment_data):
751751
self._d = treatment_data
752752
else:
753-
self._d = pd.to_numeric(treatment_data, errors="coerce")
753+
self._d = pd.to_numeric(treatment_data, errors="raise")
754754
self._X = self.data.loc[:, xd_list]
755755

756756
def _get_optional_col_sets(self):

0 commit comments

Comments
 (0)