зеркало из https://github.com/py-why/EconML.git
Enable compatability with pandas 2.0
Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
This commit is contained in:
Родитель
bc289f1e0d
Коммит
d456085953
|
@ -135,7 +135,7 @@ def simulate_residuals(ind):
|
|||
|
||||
|
||||
def simulate_residuals_all(res_df):
|
||||
res_df_new = res_df.copy(deep=True)
|
||||
res_df_new = res_df.astype(dtype='float64', copy=True, errors='raise')
|
||||
for i in range(res_df.shape[1]):
|
||||
res_df_new.iloc[:, i] = simulate_residuals(i)
|
||||
# demean the new residual again
|
||||
|
|
|
@ -598,7 +598,7 @@
|
|||
"X = Xy.drop(columns = 'SalePrice')\n",
|
||||
"X_ohe = (\n",
|
||||
" X\n",
|
||||
" .pipe(pd.get_dummies, prefix_sep = '_OHE_', columns = categorical)\n",
|
||||
" .pipe(pd.get_dummies, prefix_sep = '_OHE_', columns = categorical, dtype='uint8')\n",
|
||||
")\n",
|
||||
"y = Xy['SalePrice']"
|
||||
]
|
||||
|
|
|
@ -432,7 +432,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"categorical = []\n",
|
||||
"for col, value in attritionXData.iteritems():\n",
|
||||
"for col, value in attritionXData.items():\n",
|
||||
" if value.dtype == \"object\":\n",
|
||||
" categorical.append(col)\n",
|
||||
"\n",
|
||||
|
|
Загрузка…
Ссылка в новой задаче