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 trialEdward Smith-Langridge
2,333 PointsHi, as i am following along I get the type as "numpy.float64" rather than in the "numpy.uint16" ?
code: study_minutes = np.zeros(100) study_minutes[0] = 150 first_day_minutes = study_minutes[0] type(first_day_minutes)
numpy.float64
gregjoseph
530 Pointsgregjoseph
530 Pointsin the documentation for zeros in numpy, the default dtype when you don't specify one is float64. Since you don't have any argument beyond how many zeros to generated, the dtype assigned after the array is generated is float64. To correct the issue, specify the string format name of the dtype that you desire in the first line.
This means it would become "study_minutes = np.zeros(100, dtype= 'uint16')".