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

nbviewer.jupyter.org cannot read the Pyecharts , although used others solution #108

Closed CathyChang1996 closed 5 years ago

CathyChang1996 commented 5 years ago

Troubleshooting

Describe your environment

Operating system:MacOS 10.13.6 Python version: 3.6 Hardware:MacBook Pro 13-inch, 2017, Jupyter notebook or not? [Y/N]:Y

Describe your question

nbviewer.jupyter.org cannot read my Pyecharts

Describe the efforts you have spent on this issue

import csv
import datetime
from dateutil.parser import parse
df = pd.read_csv('Billboard Top1 1958-2018.csv')
df['datetime']=df['date'].apply(parse)
describe_song=df.set_index('datetime').resample('1y')['song'].describe()
hhh=pd.DataFrame(pd.to_numeric(describe_song['unique']))
years = list(hhh.reset_index()['datetime'].apply(lambda x: x.year).values)
YN=years[1:]
values = list(hhh.unique.values)
UNI=values[1:]

line = Line("Unique change trend")
line.add("Unique Songs", [str(y) for y in YN], UNI, mark_line=["average"], mark_point=['max','min'])
line.render('line.html')
from IPython.display import IFrame
IFrame('line.html', width=700, height=400)
CathyChang1996 commented 5 years ago

Here is the link:

https://nbviewer.jupyter.org/github/CathyChang1996/python-data-assignments/blob/master/assignment2/Analysis%20of%20%20Billboard%20Hot%20100%20Hits%20(1958-2018).ipynb?jhvuhih

hupili commented 5 years ago

You need to commit and push those HTMLs rendered from pyecharts, e.g.

http://github.com/CathyChang1996/python-data-assignments/blob/master/assignment2/Top_10_Aritists.html

IFrame will load charts from those files. Those files are actually your charts. You can double click to view them on your local disk.

hupili commented 5 years ago
screenshot 2018-11-25 at 12 34 53 am
ChicoXYC commented 5 years ago

@CathyChang1996 have you solved the problem?

CathyChang1996 commented 5 years ago

I've already solved the problem. Sorry for late response. Thanks a lot!!

ChicoXYC commented 5 years ago

Closed. Similar issues #102 #93 Please refer here.