Add INDEX_COLUMNS constant for more readablility
This commit is contained in:
parent
38c4dd5aef
commit
d5012946c2
2 changed files with 11 additions and 9 deletions
|
|
@ -30,7 +30,7 @@
|
|||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"2018-08-29 13:46:44 CEST\n",
|
||||
"2018-08-29 14:00:36 CEST\n",
|
||||
"\n",
|
||||
"CPython 3.6.5\n",
|
||||
"IPython 6.5.0\n",
|
||||
|
|
@ -82,15 +82,16 @@
|
|||
"from utils import (\n",
|
||||
" ALL_COLUMNS,\n",
|
||||
" ALL_VARIABLES,\n",
|
||||
" LABEL_COLUMNS, # groups nominal and ordinal\n",
|
||||
" NUMERIC_VARIABLES, # groups continuous and discrete\n",
|
||||
" CONTINUOUS_COLUMNS,\n",
|
||||
" CONTINUOUS_VARIABLES,\n",
|
||||
" DISCRETE_COLUMNS,\n",
|
||||
" DISCRETE_VARIABLES,\n",
|
||||
" INDEX_COLUMNS,\n",
|
||||
" LABEL_COLUMNS, # groups nominal and ordinal\n",
|
||||
" LABEL_TYPES,\n",
|
||||
" NOMINAL_COLUMNS,\n",
|
||||
" NOMINAL_VARIABLES,\n",
|
||||
" NUMERIC_VARIABLES, # groups continuous and discrete\n",
|
||||
" ORDINAL_COLUMNS,\n",
|
||||
" ORDINAL_VARIABLES,\n",
|
||||
" correct_column_names,\n",
|
||||
|
|
@ -184,7 +185,7 @@
|
|||
"correct_column_names(df.columns)\n",
|
||||
"# Use a compound index and keep both\n",
|
||||
"# identifying columns in the DataFrame.\n",
|
||||
"df = df.set_index([\"Order\", \"PID\"])\n",
|
||||
"df = df.set_index(INDEX_COLUMNS)\n",
|
||||
"# Put the provided columns into the same\n",
|
||||
"# order as in the encoded description file.\n",
|
||||
"# Note that the target variable \"SalePrice\"\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue