Skip to content

Commit d456085

Browse files
committed
Enable compatability with pandas 2.0
Signed-off-by: Keith Battocchi <[email protected]>
1 parent bc289f1 commit d456085

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

econml/data/dynamic_panel_dgp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def simulate_residuals(ind):
135135

136136

137137
def simulate_residuals_all(res_df):
138-
res_df_new = res_df.copy(deep=True)
138+
res_df_new = res_df.astype(dtype='float64', copy=True, errors='raise')
139139
for i in range(res_df.shape[1]):
140140
res_df_new.iloc[:, i] = simulate_residuals(i)
141141
# demean the new residual again

notebooks/Solutions/Causal Interpretation for Ames Housing Price.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@
598598
"X = Xy.drop(columns = 'SalePrice')\n",
599599
"X_ohe = (\n",
600600
" X\n",
601-
" .pipe(pd.get_dummies, prefix_sep = '_OHE_', columns = categorical)\n",
601+
" .pipe(pd.get_dummies, prefix_sep = '_OHE_', columns = categorical, dtype='uint8')\n",
602602
")\n",
603603
"y = Xy['SalePrice']"
604604
]

notebooks/Solutions/Causal Interpretation for Employee Attrition Dataset.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@
432432
"outputs": [],
433433
"source": [
434434
"categorical = []\n",
435-
"for col, value in attritionXData.iteritems():\n",
435+
"for col, value in attritionXData.items():\n",
436436
" if value.dtype == \"object\":\n",
437437
" categorical.append(col)\n",
438438
"\n",

0 commit comments

Comments
 (0)