Visualizing Correlation Table - Data Analysis with Python and Pandas p.4

preview_player
Показать описание
Visualizing the correlation table with matshow in Matplotlib, among other things!

Рекомендации по теме
Комментарии
Автор

you're honestly a legend to me, I've learned so many cool python tricks from your videos. Gotta love a nice correlation matrix.

johnr
Автор

Quick jupyter tip for anyone: You can run commands in the notebook by starting your line with "!". You can even use python variables in the command.


Example:


path = 'data/minwage.csv'
!head {path}


or


!pip install matplotlib

chases
Автор

You are so cool, this is like a mega tutorial while learning neat tricks. Real problem solving you got there my dude!

hectoralarcon
Автор

Amazing stuff man!! Learned a lot :D Thank you so much!

MegaTRIANGULUM
Автор

I came for the knowledge, but I stayed for the wholesome typos.

ssmith
Автор

Great video, I also recommend to rotate x axis labels:
ax1.set_xticklabels(labels, rotation=90)

Mistercapi
Автор

do we have a real reason to plot something still coding while we can use a software like Tableau, or Qilk (both have free versions) that are much more nice and explanatory (in my opinion)?

oliviero
Автор

Fun tip:

Pause all sentdex videos at 0:01 -> You can see him making a judgemental face xD

TheVijaySaravana
Автор

Nice tutorial @sentdex, thanks for sharing!. Just to let you know, there are some shortcuts that may help you. You can have the help of a function with Shift+Tab, so you can see all the arguments that you can pass to that function. Also Shift+enter, commit and creates a new row, so you don't need to create 10 rows in advance

David-zgsk
Автор

At what point should I opt for using 'to_pickle(), to_json()' or any of the other local storage methods? Are they only used for extremely large databases or should I stick with 'to_csv()' for the sake of simplicity?

Jakob
Автор

Hey Harrison. You could use the plt.subplots() function to generate the figure and the axes together, it's nrows and ncols arguments feel more easy to use in my experience than the 111/221 thing of add_subplots()

RabeezRiaz
Автор

Many thanks for the fantastic course.
I`m not sure but it feels like instead of catching the keys in dict by hand you could do:

labels = [abbv_dict[c] if c in abbv_dict else c for c in min_wage_corr.columns]
bad = [s for s in labels if len(s) > 2]
print(labels, bad, sep = '\n')


At least it worked for me (the basic data file has changed by now so there`s no FLSA )
#['AK', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'Guam', 'HI', 'ID', 'IN', 'KY', 'ME', 'MD', 'MA', 'MI', 'MN', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SD', 'UT', 'VT', 'WA', 'WV', 'WI', 'WY']
#['Guam']


bad = {'Guam':'GU', 'AK': 'blue'} # for instance there are more values

labels = [ labels[i] if labels[i] not in bad else bad[labels[i]] for i in range(len(labels)) ]
print(labels)

#['blue', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'GU', 'HI', 'ID', 'IN', 'KY', 'ME', 'MD', 'MA', 'MI', 'MN', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SD', 'UT', 'VT', 'WA', 'WV', 'WI', 'WY']

nadyamoscow
Автор

when did you made this series, i was searching alot for this but couldnt find any good material then just saw your series :D

pythonocean
Автор

The text printed at 7:53 was the return value of set_xticklabels(), you can suppress it by using a semicolon at the end of that line (very un-pythhonic, I know :D)
Also you can remove the plt.show() call by running `%matplotlib inline` in a cell somewhere before your plots.

RabeezRiaz
Автор

Sir I'm trying matplot lib in pycharm but plot doesn't show up. What can be the issue?

lifeislarge
Автор

I cannot install jupterlab because it says Could not find a version that satisfies the requirement jupiterlab, please help me out to solve this issue

harikrishnan-ppun
Автор

for those who are using jupyter notebook: at 2:20, for you to show the graph, you need to just add


import matplotlib.pyplot as plt
%matplotlib inline

beansgoya
Автор

wow, i didnt know about *read_html*, i used *plt.xticks(rotation = 90)* in my code but yours is was cooler

ShaizeOn
Автор

Question - At 4:37 you said adD_subplot(111). What if you wanted a 12x12 at the 5th position?

beansgoya
Автор

Big fan, learning a ton from you. Quick question: your methods (such as .read_csv and _head() and .DataFrame() ) come up in blue for you but just in normal black text in my jupyter notebook... how can I change that?

alexelliott