0
我已經創建了一個python函數來繪製一個小提琴劇情使用情節。該代碼是:python函數的小提琴劇情和劇情
def print_violin_plot(data1,data2,type1,type2,fig_title):
data = pd.DataFrame(columns=('Group', 'Number'))
for i in data1:
x = pd.DataFrame({'Group' : [type1],
'Number' : [i],})
data = data.append(x, ignore_index=True)
for i in data2:
x = pd.DataFrame({'Group' : [type2],
'Number' : [i],})
data = data.append(x, ignore_index=True)
fig = FF.create_violin(data, data_header='Number',
group_header='Group', height=500, width=800, title= fig_title)
py.iplot(fig, filename="fig_title")
我然後調用函數
print_violin_plot(eng_t['grade'],noneng_t['grade'],'English
Speaking','Non-English Speaking', 'Grades')
功能運行正常,沒有任何錯誤,但我沒有看到任何輸出。爲什麼?