Skip to content

Commit 751f43b

Browse files
authored
Add explicit parameters for numpy.delete
The alternative solution of using numpy.delete() to remove a column from an array is helpful, but the meaning of the arguments is not obvious without explicitly including the names. Even then, "obj" is non-obvious, so I also added a note in the solution description reminding them to use help files if necessary.
1 parent 06bb720 commit 751f43b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_episodes/02-numpy.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,10 +662,11 @@ which is the average inflammation per patient across all days.
662662
> > ## Solution
663663
> >
664664
> > An alternative way to achieve the same result is to use Numpy's
665-
> > delete function to remove the second column of A.
665+
> > delete function to remove the second column of A. If you're not
666+
> > sure what the parameters of numpy.delete mean, use the help files.
666667
> >
667668
> > ~~~
668-
> > D = numpy.delete(A, 1, 1)
669+
> > D = numpy.delete(arr=A, obj=1, axis=1)
669670
> > print('D = ')
670671
> > print(D)
671672
> > ~~~

0 commit comments

Comments
 (0)