I will not judge a programmer for being unable to use the VIM.
I will judge a “programmer” for not knowing basic data types and data structures.
Way back before computers roamed the Earth — I’m talking dinosaur times — humans couldn’t just order groceries from Alexa for delivery straight into the pantry. Consider a village of vegan dinosaur-timers. All spring and summer they would gather nuts & berries, collecting them into baskets, stocking up while they could. They had to store their food somewhere, because no storage, no food during winter. Think about it.

It’s the same with data. No data structures, no memory for data. No food during winter. Everything would be just-in-time and data would never be stored. Or very disorganized.
We want to store our data, and to do it efficiently, which is another way of saying organized. So let’s begin.
From now on, pretend there are only 2 types of ways of describing anything in this world:
- Numerical
- Not numerical.
For example, in statistics, you have two types of variables: continuous and discrete. Numerical and categorical. Whatever you want to call it. I call it this:
- Numbers
- Not numbers.
This post will touch numerical data types in python. Let’s start with Examples.
Numbers can be 0, 1, 2, 3 . . . 106, 107, 108 . . . up to the biggest number you feel like thinking about. Infinity, if you want to call it that.
For the second one. I do like the word categorical here. Boy or girl. Black or white. Yes or no. True or false. Did buy the thing we marketed for; did not buy the thing we marketed for. For those of you feeling binary, 0 or 1.
Naturally, one can have more than 2 categories. I’m a fan of maybe. Gray. And there is always something like, No idea if they bought the thing we marketed for. Trinary is one of those situations where you subtract bi from nary and add a tri and it’s still a real thing: 0, 1, or 2.
Indeed, pretend these are the only adjectives you know: numerical, and not numerical. If you’re thinking of exceptions to the numbers vs. not numbers rule, kindly forget these exceptions. For in python, you have numericals, and not numericals. Quick think of something numerical.
Now type it into python.

We’re going to get weird now. Say out loud the following sentence, “I’m going to assign this value I just printed out to a variable called, ‘x’.”
The sentence you just said is what is going on below. Proof? See for yourself.

The simple and ambiguous x is actually a horrible variable name. Perhaps pi might be a better name. Or would it? Let’s ponder that, thinking in Python.

Always be weary of what is what, regardless of the name. Variable names can lie. Always think of what the value is beneath the variable.
In practice, unless you had potentially multiple variables containing pi but all with a differing number of digits, pi is probably fine as a name for either, despite pi being technically neither 3.1459 or 3.141592653.
Variable name selection is definitely important, but don’t overthink it. Let’s move on.
Python was not the first programming language ever written. It learned from the mistakes and shortcomings of others. Thus, it has this magical keyword: type

First of all, python understands how to assign types to stuff. It decides what type something is when we create it, not the other way around. Because of this, the type keyword is super useful when you’re deep in the forest and not sure where you are.
Take another look at the output for >>> type(pi). Float. Float? Like on a river?
Naturally, python has rules for its typecasting. The variable pi, with the value 3.14159, is a float because it has a decimal point.
That’s all.
Try out any whole number and it will say (correctly) that it is an integer.

We now know 2 (numerical) python data types:
- Integer (numerical) — whole number
- Float (numerical) — has a decimal point
There’s also complex numbers in python. You can find out more about those in python’s excellent documentation. Personally, I have never used these. I’m more of a complex non-number.
2 thoughts on “How to Structure Numerical Data”