Josep Ferrer Profile picture
Apr 27 โ€ข 9 tweets โ€ข 3 min read โ€ข Read on X
Ever felt lost in Python's universe of data types? ๐ŸŒŒ

Then dive into the basics with me today!

Today we're exploring Booleans, Integers, and Floats โ€“ the core elements in Python's data type galaxy! ๐Ÿš€๐Ÿ Image
These data types are like the atoms of Python.

We start with them individually and later combine them into larger structures like lists and dictionaries.

It's a journey from simplicity to complexity! Image
1๏ธโƒฃ ๐—•๐—ข๐—ข๐—Ÿ๐—˜๐—”๐—ก๐—ฆ
Booleans are the on/off switches of Python ๐Ÿšฆ.

Booleans decide your code's route, guiding it with simple yet powerful TRUE or FALSE signals.

They're the silent guardians of logic! Image
2๏ธโƒฃ ๐—œ๐—ก๐—ง๐—˜๐—š๐—˜๐—ฅ๐—ฆ
Integers are the digital legos in Python ๐Ÿงฑ

From 0 to infinity...

they're the countable stones that pave the path of loops and arrays in your code. Image
3๏ธโƒฃ ๐—™๐—Ÿ๐—ข๐—”๐—ง๐—ฆ
Floats are the Artists of Precision ๐ŸŽจ

They're the precision points that give your calculations depth and detail, just like the delicate brush strokes on a canvas. Image
๐ŸŽผ ๐—›๐—ฎ๐—ฟ๐—บ๐—ผ๐—ป๐—ถ๐˜‡๐—ถ๐—ป๐—ด ๐—ก๐˜‚๐—บ๐—ฏ๐—ฒ๐—ฟ๐˜€ - ๐—ง๐—ต๐—ฒ ๐—œ๐—ป๐˜๐—ฒ๐—ด๐—ฒ๐—ฟ-๐—™๐—น๐—ผ๐—ฎ๐˜ ๐—•๐—ฎ๐—น๐—น๐—ฒ๐˜
Mixing Integers and Floats in Python is like a duet in music ๐ŸŽถ

Python conducts the harmony, elevating Integers to Floats for a symphony of precise computations. Image
4๏ธโƒฃ ๐—–๐—ข๐—ก๐—ฉ๐—˜๐—ฅ๐—ง๐—œ๐—ก๐—š ๐——๐—”๐—ง๐—” ๐—ง๐—ฌ๐—ฃ๐—˜๐—ฆ
Transforming data types in Python is like a wizard's spell ๐Ÿง™โ€โ™‚๏ธ.

Changing data types in Python is like casting a spell. With a flick of a function, watch a Boolean transform into an Integer or a Float! Image
Understanding Python's data types is like mastering the alphabet of a new language. ๐Ÿ“š

It empowers you to write code that's clear, efficient, and impactful.

Ready to experiment with these fundamental types?
And this is all for now! ๐Ÿค“

Did you like the thread?

Then join my freshly started DataBites newsletter to get all my content right to your mail every Sunday! ๐Ÿงฉ

๐Ÿ‘‰๐Ÿป open.techwriters.info/rfeers
Image

โ€ข โ€ข โ€ข

Missing some Tweet in this thread? You can try to force a refresh
ใ€€

Keep Current with Josep Ferrer

Josep Ferrer Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @rfeers

Apr 28
Struggling with Machine Learning algorithms? ๐Ÿค–

Then you better stay with me! ๐Ÿค“

We are going back to the basics to simplify ML algorithms.
... today's turn is Multiple Linear Regression! ๐Ÿ‘‡๐Ÿป Image
In MLR, imagine you're baking.

You've got different ingredients or variables.

You need the perfect recipe (model) for your cake (prediction).

Each ingredient's quantity (coefficient) affects the taste (outcome).
1๏ธโƒฃ ๐——๐—”๐—ง๐—” ๐—š๐—”๐—ง๐—›๐—˜๐—ฅ๐—œ๐—ก๐—š ๐—ฃ๐—›๐—”๐—ฆ๐—˜
We're using height and weight - a classic duo often assumed to have a linear relationship.

But assumptions in data science? No way! ๐Ÿง

Let's find out:
- Do height and weight really share a linear bond? Image
Read 13 tweets
Apr 26
Struggling to craft effective charts? ๐Ÿค”๐Ÿ“Š

Then, you better understand the ๐—š๐—ฒ๐˜€๐˜๐—ฎ๐—น๐˜ ๐—ฃ๐—ฟ๐—ถ๐—ป๐—ฐ๐—ถ๐—ฝ๐—น๐—ฒ๐˜€ in Data Visualization.

Today, I'm unveiling why some charts are intuitive while others are confusing ๐Ÿ’ฅ Image
Think of DataViz as your GPS in the world of numbers.

It turns complex data into clear, actionable insights.

But... why do some charts enlighten us while others don't?

The Gestalt Theory explains how our brains perceive patterns and how to take advantage of them. Image
1๏ธโƒฃ ๐—ฆ๐—ถ๐—บ๐—ถ๐—น๐—ฎ๐—ฟ๐—ถ๐˜๐˜†
Gestalt similarity means our brain groups things that look alike.

This can be because of their position, shape, color, or size.

๐ŸŽฏ This is extensively used in heat maps or scatter plots. Image
Read 8 tweets
Apr 25
Struggling with Machine Learning algorithms? ๐Ÿค–

Then you better stay with me! ๐Ÿค“

We are going back to the basics to simplify ML algorithms.
... today's turn is Multiple Linear Regression! ๐Ÿ‘‡๐Ÿป Image
4๏ธโƒฃ ๐— ๐—จ๐—Ÿ๐—ง๐—œ-๐—ฉ๐—”๐—ฅ๐—œ๐—”๐—•๐—Ÿ๐—˜ ๐Ÿ“
We can add multiple variables to perform a MULTIPLE Linear Regression.

The core theory is the same: We still use a linear function to predict our target.

But we can track N independent values

So we can consider both Height and Gender โžก๏ธ N=2 Image
5๏ธโƒฃ ๐—ง๐—ฌ๐—ฃ๐—˜๐—ฆ ๐—ข๐—™ ๐—ฉ๐—”๐—ฅ๐—œ๐—”๐—•๐—Ÿ๐—˜๐—ฆ ๐ŸŽฒ
MLR accepts both numbers and categories.

HEIGHT is a numerical variable - which is a variable that can be measured.

GENDER is a category - It splits our data into different groups. Image
Read 8 tweets
Apr 24
Ever felt confused by SQL's execution flow? ๐Ÿค”

Then you better stay with me!

Today let's exemplify SQL's execution order with a simple query๐Ÿ‘‡๐Ÿป Image
1๏ธโƒฃ ๐—ฆ๐—ง๐—”๐—ฅ๐—ง๐—œ๐—ก๐—š ๐—™๐—ฅ๐—ข๐—  ๐—ข๐—จ๐—ฅ ๐—ฅ๐—”๐—ช ๐—ง๐—”๐—•๐—Ÿ๐—˜
We use a dummy table with the salary of employees depending on their field and experience,

๐ŸŽฏ Our main goal?
Understand the field that earns the most. Image
2๏ธโƒฃ ๐—ฆ๐—ค๐—Ÿ ๐—ค๐—จ๐—˜๐—ฅ๐—ฌ ๐—ฆ๐—ง๐—ฅ๐—จ๐—–๐—ง๐—จ๐—ฅ๐—˜ (to use)
We define a query to obtain our goal data. Image
Read 13 tweets
Mar 29
Want to become a SQL Pro and no idea where to start?

Then, you better...

๐Ÿ‘‰ SAVE these 9 steps to become an SQL Pro! ๐Ÿ‘ˆ Image
1๏ธโƒฃ ๐—™๐—ผ๐˜‚๐—ป๐—ฑ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ฆ๐—ค๐—Ÿ:
Understand basics like SELECT, WHERE, JOIN, and ORDER BY.

We all need to start from the basics!
2๏ธโƒฃ ๐—”๐—ฑ๐˜ƒ๐—ฎ๐—ป๐—ฐ๐—ฒ๐—ฑ ๐—ค๐˜‚๐—ฒ๐—ฟ๐˜† ๐—ง๐—ฒ๐—ฐ๐—ต๐—ป๐—ถ๐—พ๐˜‚๐—ฒ๐˜€:
Explore subqueries, correlated subqueries, CTEs, and set operations (UNION, INTERSECT, EXCEPT).
Read 12 tweets
Feb 16
Struggling with Machine Learning algorithms? ๐Ÿค–

Then you better stay with me! ๐Ÿค“

Today I am starting with a new ML model
... so it is the turn of the Support Vector Machine! ๐Ÿ‘‡๐Ÿป Image
0๏ธโƒฃ ๐—ฅ๐—˜๐—–๐—”๐—ฃ
SVM is a ML method that finds the optimal hyperplane separating classes by maximizing margin, using support vectors to ensure the greatest distance between class data points. Image
1๏ธโƒฃ ๐— ๐—”๐—ง๐—›๐—˜๐— ๐—”๐—ง๐—œ๐—–๐—”๐—Ÿ ๐—œ๐—ก๐—ง๐—จ๐—œ๐—ง๐—œ๐—ข๐—ก ๐Ÿงฎ
To classify our data, we apply some intuition:

The dot product is the projection of one vector along with another. So we can use it to determine whether a data point is one class or the other. Image
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(