hupili / python-for-data-and-media-communication-gitbook

An open source book on Python tailed for communication students with zero background
117 stars 62 forks source link

Week9_Data Viz Comments #78

Closed rippleYJH closed 5 years ago

rippleYJH commented 5 years ago

Here are three quick feedback for Week 9 notes:

  1. For setting up the font part, the command "!open" doesn't work on my computer. I think it is because of the Window system. But we could try the command "matplotlib.get_cachedir()" , and it works.

  2. I don't know why when I set the color, it sometimes raises such ValueError: image

  3. When I executed the plotly, it will return with errors like this...

image

Thanks a lot if you can help me solve!

ChicoXYC commented 5 years ago

thanks. about question 2, where did it go wrong? and about question 3, I'm not sure what's happening here @hupili do you know this problem?

rippleYJH commented 5 years ago

country_counts = df['country'].value_counts()[:15].sort_values(ascending=False) country = pd.DataFrame(country_counts) fig = plt.figure(figsize=(14,7)) plt.bar(country.index, country.country,color = '#46c99',edgecolor = '#40b4e5')

But actually when I tried your codes, it works... So I have no idea why it raised a ValueError.

SerenaQYHuang commented 5 years ago

For the first question, I don't think there's such a command !open in Note09. Did you mean '!pip install' or open() ?

rippleYJH commented 5 years ago

I think it is open()

FLYSTEPHEN commented 5 years ago
ChicoXYC commented 5 years ago

update the plotly offline method, which does not require an account. please see here.