Matt Harrison Profile picture
Python 🐍 + Data Science 🚀 trainer @__metasnake__ 🦜 Speaker ✍ Author 👨‍🏫 Instructor (@Stanford) 📣 DM for Sponsorship
Aromat Profile picture valuepiper Profile picture Jason Profile picture 4 subscribed
Apr 19 6 tweets 2 min read
XGBoost is a popular machine learning algorithm that provides excellent performance out of the box for various types of machine learning problems, including regression and classification. Image However, one common issue with XGBoost is overfitting, leading to poor generalization and inaccurate predictions on new data.

Overfitting occurs when the model learns the training data too well, including the noise and randomness, and cannot generalize to new data.
Mar 15 10 tweets 3 min read
Big O notation (pronounced Big-Oh) is a way to discuss how long an algorithm takes to run. It is also called "runtime complexity".

Understanding this is key for technologists.

Let's look at it.

1/
If we want to calculate the mean of a sequence, a naive implementation will calculate the sum and divide it by the length:

2/ Image
Mar 6 7 tweets 2 min read
A thread about pandas... (The library not the animal)

🐼🧵 Image I like to describe pandas:

⋅ Like Excel

⋅ Like SQL

Things that you would do with Excel or SQL, you can program in pandas Image
Feb 8 13 tweets 4 min read
I often teach about Decorators in Python.

Many know how to use them, but few can write them.

These are tricky because nested functions make our brains hurt.

Here are some hints for grokking them.

1/ Image In short, decorators allow you to inject orthogonal behavior before or after a function is executed.

But my favorite decorator definition is related to the construction and will help you easily create them: A callable that takes a callable and returns a callable.

2/
Oct 13, 2023 13 tweets 4 min read
I often teach about Decorators in Python.

Many know how to use them, but few can write them.

These are tricky because nested functions make our brains hurt.

Here are some hints for grokking them.

1/ Image In short, decorators allow you to inject orthogonal behavior before or after a function is executed.

But my favorite decorator definition is related to the construction and will help you easily create them: A callable that takes a callable and returns a callable.

2/
Sep 21, 2023 13 tweets 4 min read
I often teach about Decorators in Python.

Many know how to use them, but few can write them.

These are tricky because nested functions make our brains hurt.

Here are some hints for grokking them.

1/ Image In short, decorators allow you to inject orthogonal behavior before or after a function is executed.

But my favorite decorator definition is related to the construction and will help you easily create them: A callable that takes a callable and returns a callable.

2/
Sep 7, 2023 15 tweets 4 min read
Here are is a common Pandas operation with a twist. 🐼

I'll present frequent suggestions, and then better suggestions.

🧵 Here's our data, the 2020 Python developers survey from
@JetBrains
.

I'll just use a subset so it will fit in tweets better. Image
Aug 16, 2023 6 tweets 2 min read
A reader asked how to split a single (tuple) column into multiple columns in a chain...

Let's go. 🐼💪 Image Let's recreate their data: Image
Aug 2, 2023 9 tweets 2 min read
Recently, I've been working on a new course for data analytics. This Python code stands out for its ability to turn raw sales data into insightful visualizations. I want to share why this code is crucial and how it could help transform your data analysis process. Image The code helps visualize sales data, focusing on different countries, by using Pandas and Matplotlib. It transforms sales data into weekly aggregates, filtering out UK data, and highlights specific countries of interest (in this case, Finland).
Jul 18, 2023 7 tweets 2 min read
A thread about pandas... (The library not the animal)

🐼🧵 Image I like to describe pandas:

⋅ Like Excel

⋅ Like SQL

Things that you would do with Excel or SQL, you can program in pandas Image
Apr 27, 2023 13 tweets 5 min read
I often teach about Decorators in Python.

Many know how to use them, but few can write them.

These are tricky because nested functions make our brains hurt.

Here are some hints for grokking them.

1/ Image In short, decorators allow you to inject orthogonal behavior before or after a function is executed.

But my favorite decorator definition is related to the construction and will help you easily create them: A callable that takes a callable and returns a callable.

2/
Apr 27, 2023 4 tweets 2 min read
Here's what I'm running on my @elgato Stream Deck.

Media controls, pomodoro timer, local time, Zoom mute, and (two buttons) for Zoom Exit (need to hit Return after hitting the Run button 🤷‍♀️) Image World times (useful for client work and meetings).

Application launchers. (Some of these should be launched at startup on Windows... 🤔Looking at you TPFanControl and PowerToys.) Image
Apr 20, 2023 6 tweets 2 min read
Inspired by @svpino and @dvassallo, I want to be more deliberate with my tweeting. To start that off, I wanted to understand (quantitatively) how I tweet. And that is the essence of "Applied Pandas: Twitter Analytics". I show how to access your Twitter data, set up an environment, and perform exploratory data analysis on it. 📉
Apr 20, 2023 8 tweets 3 min read
Suggestions for writing better Python code:

📝Use an Editor that gives feedback
✅Format consistently
🧪Test your code
🦆Use type hints
📚Learn Python idioms Editors like @pycharm, @code can give you quick insight into coding issues.

I have @emacs configured to do similar. Image
Apr 18, 2023 8 tweets 2 min read
One of the most important choices you have in life is your work. 👷

How do you decide where to work?

What to do?

How do you get your first job?

When to start looking for a new job?

🧵 Most people want a job that has both satisfying work and good perks...
Apr 4, 2023 7 tweets 3 min read
A thread about pandas... (The library not the animal)

🐼🧵 I like to describe pandas:

⋅ Like Excel

⋅ Like SQL

Things that you would do with Excel or SQL, you can program in pandas
Apr 3, 2023 6 tweets 2 min read
Inspired by @svpino and @dvassallo, I want to be more deliberate with my tweeting. To start that off, I wanted to understand (quantitatively) how I tweet. And that is the essence of "Applied Pandas: Twitter Analytics". I show how to access your Twitter data, set up an environment, and perform exploratory data analysis on it. 📉
Dec 16, 2022 10 tweets 3 min read
Big O notation (pronounced Big-Oh) is a way to discuss how long an algorithm takes to run. It is also called "runtime complexity".

Understanding this is key for technologists.

Let's look at it.

1/
If we want to calculate the mean of a sequence, a naive implementation will calculate the sum and divide it by the length:

2/ Image
Dec 14, 2022 6 tweets 2 min read
A reader asked how to split a single (tuple) column into multiple columns in a chain...

Let's go. 🐼💪 Image Let's recreate their data: Image
Oct 18, 2022 5 tweets 2 min read
Real world Pandas is a little more complicated than just one-off operations to change one thing with your data.

If you write a recipe for your data, it will ease understanding the process you go through. Image Here's a recipe to clean up the Ames housing dataset. Image
Oct 17, 2022 8 tweets 3 min read
Upcoming training:
Oct:
🏭Python in Production Course

Nov:
🐼Intermediate Pandas Course
🐻Intro to Polars Workshop
📈Seaborn Objects Workshop
📊Fundamentals of Data Analysis with Pandas Course
🧪Beginning Pytest Workshop
👩‍🔬Advanced Pytest Workshop Best practices for production Python code:

corise.com/go/python-prod…