Teddy Petrou Profile picture
💪 Master the Python Data Science Ecosystem 💪 🕴️Founder of Dunder Data 📚Author of multiple books 💻Developer of Dexplot https://t.co/QSRQLcRY0g
Jun 21, 2022 12 tweets 3 min read
In 2014, I was first introduced to pandas and had no idea how to use it.

By 2017, I had written the 500 page book Pandas Cookbook

Here's my step-by-step guide to mastering pandas for free This is roughly the path I took:

1. Read the docs
2. Practice examples in the docs
3. Flashcards
4. Share a full data analysis w/ others
5. Answer old SO Qs
6. Answer new SO Qs
7. Teach others in-person or online
8. Write pandas blog posts
Jun 2, 2021 4 tweets 2 min read
Professor of public health does not understand that the year 2019 existed and showed Sweden far below expected deaths. 2021 also exists and again shows Sweden far below expected.

Total 2019-21 excess deaths is approaching 0. These are the people that destroyed our lives, our childrens lives with most devastation to the poorest. There is an extremely strong relationship to poverty and death in covid (in the US and the world). All from the comfort of their home, wearing a mask 30 minutes a week.
Jun 2, 2021 7 tweets 1 min read
Israel covid deaths from the last 2 weeks of May

May 18-31, 2020 - 12
May 18-31, 2021 - 23

Vaccine enthusiasts say with certainty that deaths dropped in 2020 because of lockdowns and masks and dropped in 2021 because of vaccines. Lockdowns and masks were not able to keep covid deaths this low during the three waves that followed in Israel July, 2020 - March, 2021
Jun 2, 2021 5 tweets 1 min read
Hi Nick,

Could you tell me why you wouldn't prescribe Ivermectin to someone with severe C19 disease and is likely to die from it within the next couple weeks? Ivermectin is not a miracle drug, but most in vivo studies show some efficacy.

Here are all 208 results from PubMed that mention Ivermectin and COVID-19

pubmed.ncbi.nlm.nih.gov/?term=ivermect…

Most are positive, some are not.
Jun 1, 2021 4 tweets 2 min read
A complete collapse in covid cases in most Indian states. Interesting that the most populous state, Uttar Pradesh (200m), has had some of the best results, while Tamil Nadu some of the worst.

Uttar Pradesh govt praises Ivermectin for great results. Tamil Nadu denies citizens use Links:

Uttar Pradesh indianexpress.com/article/cities…

Tamil Nadu thedesertreview.com/opinion/letter…
May 29, 2021 26 tweets 7 min read
I am putting together all of my thoughts on how to understand a particular year's number of deaths.

To do so, I would like to explain the excess deaths in the Nordic countries + New Zealand in 2019-21, graphed below. The most striking feature of the above graph is the remarkably different path that Sweden took the last 2.5 years. It's closing in on 0 total excess, which is what we would expect for an accurate model.

The rest of the thread explains the model and the higher variance in Sweden
Feb 7, 2021 11 tweets 2 min read
In your opinion, what is the single best piece of evidence to show someone who believes in lockdowns that they didn't work?

For me, it will be New Zealand's large increase in deaths in 2021. NZ was praised routinely by the media as a country that prevented covid. It is absolutely true that they prevented deaths from covid as well as overall deaths in their elderly. 2020 winter elderly mortality rates were historically low.
Feb 7, 2021 6 tweets 1 min read
Death analysis for dummies:

Countries A and B each average 100 deaths per year.

In year X, A has 96 deaths and B has 100.
In year X + 1, A has 104 and B has 96
In year X + 2, A has 100 and B has 104

A has 8.3% increase in Year X+1 - media goes crazy and Praises B for decrease. By year X + 2, both countries record the same number of deaths.

This is almost the exact scenario that Sweden and New Zealand are in.
Jan 28, 2021 11 tweets 3 min read
SWEDEN THREAD CORRECTION

Sweden's 80+ age group in 2020 recorded mortality rate equal to the AVERAGE of 2011 - 2018.

Those under 65 had the 2nd LOWEST mortality rate

Those 65-79 tied for the HIGHEST mortality rate

A deep dive into how this happened👇👇👇 Image Overall death numbers are meaningless without stratifying by age. Below, we have mortality rates from 2011-2020 by age groups 0-64, 65-79, 80-89, and 90+. Image
Jan 28, 2021 10 tweets 3 min read
Sweden's elderly in 2020 recorded one of the lowest mortality rates in history.

Overall mortality rates in Sweden by age were excellent in 2020 and better than the 2015-2018 average mortality rates for nearly all age groups.

A deep dive into why 👇👇👇 Overall death numbers are meaningless without stratifying by age. Below, we have mortality rates from 2015-2020 by age groups 0-64, 65-79, 80-89, and 90+. The 65-79 group fared worst with ~3% inc. over 2015-18 average.

Amazingly, the 90+ group had lower mortality in 2020.
Jan 26, 2021 6 tweets 2 min read
🚀🚀🚀Python Pandas Certification Track Launched!!

I'm offering 8+ live online courses covering all of the pandas library. You'll have to pass challenging certification exams at at the end of each course to prove your expertise analyzing data with pandas

dunderdata.com/live-online-co… These courses target those that want to use pandas efficiently and effectively to produce trusted results in a professional environment from a world expert

I've written thousands of pages on pandas, developed hundreds of exercises and projects to help you become an expert
Jan 5, 2021 8 tweets 2 min read
India has soundly defeated covid with herd immunity.

coronavirus.dunderdata.com

Seroprevalence studies show up to 75% positive for covid antibodies.

True incidence rate is likely higher as antibodies decay or go undetected.

India is the model for covid Nearly all Indian states have seen drops in cases/deaths of 80-90% from their peak. Below, we have the 15 largest Indian states with the final graph an aggregate of all others.
Jan 3, 2021 19 tweets 3 min read
I gave masks the benefit of the doubt in the spring/summer of 2020. I have since changed my mind and see no scenario where it makes sense to wear them in public.

Even if they provided 100% protection, I believe masks to be harmful. An explanation below 👇👇👇 Let's say masks provide 100% protection to both the wearer and others (perhaps non-masked individuals) in close proximity. This is perhaps the worst scenario.

The immune system requires a consistent influx of both microbes and viruses to remain trained.
Jan 2, 2021 7 tweets 2 min read
In 2019, Sweden recorded its lowest ever mortality rates for those under 65.

In 2020, women under 65 will record their best ever mortality rates and men their second best ever.

Explanation 👇🏻👇🏻👇🏻 Total deaths for the under 65 population through early dec (men/women)

2019 - 9400 (5700/3700)
2020 - 9700 (6100/3600)

This is not taking into account pop. increase of ~0.5%.

statistikdatabasen.scb.se/pxweb/en/ssd/S…
Jan 2, 2021 6 tweets 3 min read
@denisrancourt I believe the efficacy to be 0. It is trivially easy to pull off paper efficacy of >90%. Heres how done.

1. Have no one deliberately exposed to the virus
2. Only test those that report symptoms
3. Give a placebo (saline) shot with no side effects
.. @denisrancourt 4. Fail to run a test group with no shot
5. Fail to run a test group with non-pharma intervention such as exercise, diet and vitamin D
6. Fail to run test group with on related immune boost
7. Partipants knew which group they were in based on the side effects.
....
Dec 15, 2020 14 tweets 3 min read
Sweden's two-year mortality rate in 2019-2020 is one of the lowest in the last 10 years.

I even overestimated 2020 deaths by 2-3%.

Share this to everyone you know who tries to point at Sweden as an example of covid policy failure.

Their strategy has been a huge success. Data is directly from Statistics Sweden - scb.se/en
Dec 4, 2020 5 tweets 2 min read
.@CDCgov - Why is your upper bound threshold for deaths less in 2019 than in 2020? This is extremely fishy to me.

It's overall 2.3% less for the same periods in 2019 vs 2020 or ~63k. Image For those who want an explanation. The CDC uses this chart to estimate excess deaths, but the upper bound threshold in 2020 is 2.3% lower than it was for 2019. US population is growing.

cdc.gov/nchs/nvss/vsrr… Image
Mar 2, 2020 9 tweets 3 min read
Explanation of matplotlib "inches" - a tutorial thread

Inches is a relative term. You must know the figure dpi (dots per inch) and your screen's dpi to make sense of it. Default inline dpi is 72. Below figure is 5 x 2 "figure inches" or 360 x 144 pixels. Using a screen ruler program (Onde Rulers) it actually measures as 2.2 x .98 "screen inches" on my screen and 324 x 144 pixels
May 22, 2019 6 tweets 2 min read
There are many types of scikit-learn Estimators. The most common are:
Regressors
Classifiers
Clusterers
Transformers
Meta-estimators

Read their exact definition in the glossary scikit-learn.org/stable/glossar…

They all follow the same three-step process - import, instantiate, fit Here are examples of each one. They all look the same

# Regressor
from sklearn.linear_model import LinearRegression
lr = LinearRegression()
lr.fit(X, y)