Pandas Apply Exercises—US Crime Rates

preview_player
Показать описание
Maybe the main take away here is even “real data scientists” with a decade of experience sometimes ride the struggle bus. So, when you’re on the struggle bus give yourself some grace. Don’t give up. We ALL struggle sometimes. 

Sometimes we learn best by doing. Unlike my other videos, I’ll be going through these exercises cold. Sometimes we’ll encounter ambiguous questions, and sometimes I'll be wrong. Learning from our mistakes can be a powerful teacher. So, it’s OK to be wrong now, because we’ll know how to avoid it next time when it counts. My hope is that you will learn by doing. Why don’t you proceed through the linked exercises before we walk through them together? This series can be viewed in tandem with my “An Opinionated Guide to pandas“ video series (links below), but it’s not required. This series is beginner-friendly but aimed most directly at intermediate users.

This Learning by Doing is part of the pandas Opinionated Guide series:

The jupyter notebooks can be found here:
Рекомендации по теме
Комментарии
Автор

Easiest way to calculate decade: decade = (year // 10) * 10. Example for year 1985: decade = (1985 // 10) * 10 --> 1980. Thanks Nat always!

tomparatube
Автор

So happy to see contents like this. It really helps to put what I learned together and now I have a clear workflow in mind while dealing with data. Thanks!

ruchen
Автор

Things I learned from this lecture:

* / operator do a floating-point division, and added the // operator to do integer division
*df.resample('10AS').sum()
*df.resample('10AS').last()
*df.div(df['a'], 'rows')

arhataria
Автор

I really enjoy these challenge type videos you do. Great ideas for 'hacking' data with pandas. The 'aha' moments are brilliant!

finnmccool
Автор

I'm so excited to find your channel! Just subscribed! I'm planning to finish your lectures but I've found many playlists on your channel. (Bit of Deep Learning and Keras, A Bit of Data Science and Scikit Learn, Introduction to Data Science - Foundations, Seaborn: Understanding the Weird Parts, Python Keras — Deep Learning Building Blocks, etc..)
I'm definitely going to finish this 'Learning by Doing' playlist, but, if it doesn't bother you, could you please give me a recommendation which order i should go through? I have somewhat basic understanding of pandas and sklearn, and want to learn more from you. Again, I'm very excited to meet your valuable knowledge and insight! Thanks in advance!

arhataria
Автор

I benefited a lot and enjoyed watching your explanation..please can you help me how to find a column representing crime rate by location or region..thank you for your kindness

Engmays-bjgr
Автор

Thanks for the video. Uhm, I could not find the dataset and notebook. Could you please give a link.

semihcetin
Автор

I like the way you use floor division to determine the decade
I would have used a much more complicated function but your way is a lot simpler

immanuelsuleiman
Автор

hey men thanks for the video can you share the link to the data

davidrosen
Автор

I can't find the dataset. Could someone please share the link so that I can practice and learn. Thanks!

_proton
Автор

Hey just saw the video. Doesn't the most dangerous mean total crime? If we sum total crimes per decade and divide by the population we get crime per person and the 80's as the most dangerous decade to live in. Also, I completely forgot about .idxmax()
Would like to see more videos

akhil
Автор

Step 9
Imagine that the column 'Total' never existed. We want to see in which decade there were most crimes.

crimes.iloc[:, 1:-1].sum(axis=1).nlargest(1)

We sum data by rows but omit column 'Population' because it is not related to the number of crimes.

bartomiejonak