- Podcasts
- CyberSecurity Summary
- Data Science from Scratch: First Principles with Python
Data Science from Scratch: First Principles with Python
CyberSecurity Summary
- May 16, 2026
- 20 min
About this episodeAn educational resource designed to teach the fundamentals of data science using the Python programming language. Rather than relying on…
You can listen and download our episodes for free on more than 10 different platforms:
https://linktr.ee/cyber_security_summary
Get the Book now from Amazon:
https://www.amazon.com/Data-Science-Scratch-Principles-Python/dp/149190142X?&linkCode=ll2&tag=cvthunderx-20&linkId=e4c439a79b10c5d148e6695eb48f81ca&language=en_US&ref_=as_li_ss_tl
Discover our free courses in tech and cybersecurity, Start learning today:
https://linktr.ee/cybercode_academy
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Data Science from Scratch: First Principles with Python
I mean it sounds like corporate espionage or literal mind reading, it really does, But it's actually just recognizing patterns in you know, seemingly mundane data like unscented lotion purchases suddenly correlating with a second trimester, or, in the case of the twenty twelve Obama campaign, finding the exact combination of demographic data and pass voting behavior that signals that a person just needs a very slight nudge to actually show up at the bulls, Which.
Which is exactly why so many people get a massive shock when they actually step into the discipline of data science itself. Oh for sure, because that glossy interface it's entirely stripped away. You are suddenly looking at a landscape that is raw, messy and honestly totally unforgiving. Yeah, and a concerning number of practitioners today are they're overly reliant on shiny, prepackaged libraries.
Because data science isn't about memorizing syntax to import a machine learning library, right, It's about answering questions that no one has even thought to ask yet. Yeah, and those answers are buried in this massive glut of everyday information. You can only extract them if you fundamentally understand the tools you're holding.
I mean, it's a great framing device. So on your very first day, the VP of networking drops a massive data dump on your desk as they do, right, and gives you your first assignment identify the key connectors among the users. But this data isn't sitting in some neat, easily searchable database.
Precisely, if Done leads the network, his three friends can still talk to each other through other paths WHOA. But if Thor leads a network, it literally breaks in half. The flow of information stops entirely. Thor is a bottleneck. Intuitively, that makes him far more critical to the network than Done despite having fewer direct friends.
You would have And that proves why you can't blindly trust a default metric. You have to look at the structure of the data. You have to build functions that look at say mutual friends or shared interest. And to build those functions you have to use the language, in this case Python, But you don't just write Python. The book Stress is right pythonic.
If you're copying and pasting a block of logic to analyze, say, user salaries, and you have one accental space, the entire script crashes. It forces discipline, but the reward for that discipline is access to incredibly elegant tools right out of the box, things like default, picked encounter.
It's incredibly clunky. A standard dictionary throws a literal error if you try to modify a key that doesn't exist yet. Oh really yeah, So as your program reads the word hadoop for the very first time, you have to write logic that says, check if hadoop is in the dictionary. It isn't. Okay, create the key hadoop and set the value to one.
It transforms a multi step, error prone loop into a single elegant command exactly. Oh wait, you just casually mentioned a list of a million words. When we're dealing with data at scale, moving a million items around has to cause problems, huge problems. Like if I try to assign a list of a million numbers to a variable, Python is literally allocating memory for all one million of those numbers instantly, right correct, And if.
Okay, all of this, the dictionaries, the generators, it's beautiful logic. But all of these elegant Python tools are really just for us, the develops. Sure, if I take a default dict full of raw frequencies and drop it on the VP of networking's desk, their eyes are going to glaze over. You have to translate those numbers into a visual space, which.
The book touches on the standard toolkit, you know, bar charts for buckets of discrete data, line charts for continuous trends, scatterplots for pairing two variables together to see if they correlate. The basics, right, but we don't need to dwell on what a line chart is. What's interesting is that the book spends a very specific amount of time warning the reader about the mechanics of visual deception.
Here's where it gets really interesting. The example Groose uses is brilliant. Let's say we are tracking how many times the phrase data science is mentioned on user profiles YEP. The data shows that in twenty thirteen there were five hundred mentions. In twenty fourteen there were five hundred and five mentions.
Well, what's fascinating here is this vulnerability is exactly why the premise of the book is so vital. How So, when you use black box visualization libraries, they often auto scale the axes based on the minimum and maximum values of the data provided. Oh, I see a tool might automatically crop the access to four ninety nine without any malicious intent, just to save space on the screen.
Me, yes, or a human might do it intentionally to sell you a false narrative. But when you learn Matt plotlib from scratch and you physically write the code to define the axis limits, you see how it works exactly. You internalize the mechanics of how the visual is constructed. You train your brain to instantly look at the axis before you let the shape of the line influence your judgment. You're basically immunizing yourself against bad data science.
And concretely, for our purposes anyway, there are simply points in a finite dimensional space. Representing user data as vectors is the foundational trick of machine learning. The text gives a very grounding example a person's physical attributes. You have a list of three numbers seventy one, seventy and.
Vectors must be added component wise. The first element of vector A adds to the first element of vector B. So if vector A is one two and vector B is two one, the zip function acts like a physical zipper. It takes the first element from both lists, the one and the two, and binds them into a pair. Then it takes the second elements the two in the one and binds them.
This is how algorithms determine similarity. If you plot the interest of two users as massive vectors, and you calculate the cosine of the angle between them using the dot product, the math tells you exactly how similar those two people are. A small angle means their vectors are pointing in the exact same direction. They like the exact same things. That is literally how Acupid knows who you should date.
That is fascinating, But I have to be completely honest here. I'm looking at the sheer amount of code it takes to build a vector ad function from scratch using zip and list comprehensions. Highly optimized libraries like numpi can execute vector addition across millions of data points in a fraction of a millisecond.
It's a fair question, but think of it this way. If you don't understand basic arithmetic, a pocket calculator seems like a magic box. You punch in some numbers and it spits out the truth, right. But if you accidentally hit the division key instead of the multiplication key, the calculator will spit out a completely absurd answer.
Relying on numbpi without understanding linear algebra is the exact same danger, but on a massive scale. When everything works, you're fine. But what happens when you encounter the curse of dimensionality? The what the cursive dimensionality? What happens when you're dealing with data in one hundred dimensions and the distance between all your points mathematically approaches uniformity, breaking your predictive model.
We took those insights and visualized them, digging into the mechanics of the axis so we could actively defend ourselves against manipulated narratives. Yes, and finally, we translated our users into mathematical vectors, exploring the literal architecture of similarity that powers every recommendation engine on Earth.
I want to leave you with a final thought to chew on something that stretches beyond the scope of Python two point seven. Okay, we've spent this entire deep dive manually building these models so we can truly comprehend the how and the why. When we talk about a three dimensional vector of height, weight, and age, our human brains can picture it. We can imagine that dot floating in a room.
They are finding mathematical correlations in vector spaces that no human mind can actually visualize or comprehend. So the provocative question is this, as these self learning algorithms become infinitely more complex, will we eventually reach a threshold where even the mechanics, the people who build system from absolute scratch, can no longer truly understand the why behind the insights the machine produces.
