Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJahmila Roberts
9,327 PointsVisibleDeprecationWarning?
I am getting this warning when I try to create the new study_minutes array:
<ipython-input-81-f1dabc6571fc>:1: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray study_minutes = np.array([
I used the same code as presented in the video but it's not creating the same shaped array (2, 100)
Code: study_minutes = np.array([ study_minutes, np.zeros(100, np.uint16) ])
2 Answers
Megan Amendola
Treehouse TeacherThis comes from an update to NumPy. It wants you to now input it as: study_minutes = np.array([ study_minutes, np.zeros(100, np.uint16)], dtype=object)
Which version of NumPy are you using at the moment? You can run print(np.__version__)
inside of your Jupyter Notebook to see.
Evert-Jan van Dijk
1,383 PointsNever mind it's already been solved, I had forgotten to run all the previous code, since I started a new session.
Evert-Jan van Dijk
1,383 PointsEvert-Jan van Dijk
1,383 PointsI am on version 1.19.2. Adding
dtype=object
does remove the error message, however leaves some awkward bugs. When runningstudy_minutes.shape
it returns(2,)
andstudy_minutes
returns a couple of nested tuples of arrays or whatever:Do you know of any solutions to this problem? Please tell me.