Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Introduction to NumPy Array Programming Routines in Action

NameError: name 'float16' is not defined

Hello,

NameError: name 'float16' is not defined

Does anyone know why Craig's NumPy code (between 2:00 and 3:00 of the Routines in Action video) has his array returning dtype=float16?

I had to set my final parameter as such:

students_gpas = np.array([[3.3, 3.3, 3.3], [3.3, 3.3, 3.3], [3.3, 3.3, 3.3]], dtype=float)

If I set it to float16, error occurs. Please assist if you can, thank you :)

oh, i found the answer in my notes... one would type dtype=np.float16 or dtype=np.uint8 as a parameter.

hooray :|

1 Answer

oh, i found the answer in my notes... one would type dtype=np.float16 or dtype=np.uint8 as a parameter.

hooray :|