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 trialAlex Peck
6,907 PointsHow did you choose DATATYPES?
I'm able to follow along with the code, but I'd like to know a bit more about how and why you chose the options you did for the data types.
Would you please explain: i, f8, a200, <i8, |SXXX.
My understanding is that these relate to integers, floats (up to 8 decimals), no idea about a200, integers (less than 8 decimals), and strings up to a certain length...
... but these are just my guesses and I'd love to know a bit more from the teacher about why she choose the data type and how to think about choosing data types for our own projects.
Also, it looks like you can use basic Python operators to fine tune the datatypes.
This seems like a rich vein to mine for more info.
Thanks!
3 Answers
John Marquess
11,783 PointsFrom the numpy
reference for array dtypes in the docs:
The first character specifies the kind of data and the remaining characters specify the number of bytes per item.
'b' boolean
'i' (signed) integer
'u' unsigned integer
'f' floating-point
'c' complex-floating point
'O' (Python) objects
'S', 'a' (byte-)string
'U' Unicode
'V' raw data (void)
Available here:
Carlos Caro
9,528 PointsThe instructor should be more clear where information is coming from ... just pasting content doesn't help the students
man odell
1,905 Pointsthis is one of python advantages or high level language (easy to write), no variable type in python language same as java or c but in variable name u should write character in first litter of your variable name
Gregory Thompson Jr.
237 PointsThere's a type once it's defined. All objects come with a type, an id, and a value.
Alex Peck
6,907 PointsAlex Peck
6,907 PointsThank you John! This is just what I was looking for.