Skip to content

Commit

Permalink
Update assignment03_decision_trees.ipynb (Yorko#742)
Browse files Browse the repository at this point in the history
Fixed plot for newer package versions:
"ValueError: Number of rows must be a positive integer, not 3.0"
"AttributeError: module 'numpy' has no attribute 'object'."
  • Loading branch information
IKolzin authored Mar 17, 2023
1 parent 1275932 commit ca5d7b7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@
"cols = 5\n",
"rows = np.ceil(float(data_train.shape[1]) / cols)\n",
"for i, column in enumerate(data_train.columns):\n",
" ax = fig.add_subplot(rows, cols, i + 1)\n",
" ax = fig.add_subplot(int(rows), cols, i + 1)\n",
" ax.set_title(column)\n",
" if data_train.dtypes[column] == np.object:\n",
" if data_train.dtypes[column] == object:\n",
" data_train[column].value_counts().plot(kind=\"bar\", axes=ax)\n",
" else:\n",
" data_train[column].hist(axes=ax)\n",
Expand Down

0 comments on commit ca5d7b7

Please sign in to comment.