第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用 ipywidgets 在 HMTL 中顯示 Toogle 按鈕的輸出?

如何使用 ipywidgets 在 HMTL 中顯示 Toogle 按鈕的輸出?

斯蒂芬大帝 2023-10-04 15:58:40
使用jupyter筆記本,切換按鈕的輸出工作順利。但是,當我將其另存為 html 時。HTML 無法顯示切換按鈕的輸出下圖是html格式,切換按鈕無法顯示輸出。但在 jupyter 中它工作得很好。https://i.stack.imgur.com/WMpST.png 我正在使用這個代碼。import numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport ipywidgets as widgetsfrom IPython.display import display, Markdown, clear_output, HTMLfrom IPython.display import displayfrom ipywidgets.embed import embed_minimal_htmldata=[[47,15,3,5,7],[33,13,4,7,2],[25,17,9,3,5]]df = pd.DataFrame(data, columns=['VAR_A','VAR_B','VAR_C','VAR_D','VAR_E'])toggle = widgets.ToggleButtons(options = df.columns, description = 'Variables:', button_style = '')out = widgets.Output()def toggle_plot(button):    with out:        if button['new']:            out.clear_output()            plt.ioff()            ax=plt.gca()            sns.barplot(x=toggle.value, data=df)            display(ax.figure)            plt.clf()         else:            out.clear_output()toggle.observe(toggle_plot, 'value')display(toggle)display(out)embed_minimal_html('try.html', views=[toggle], title='try')我也嘗試在jupyter筆記本中使用這兩個函數(shù)進行保存,但它保存的是空html。!jupyter nbconvert --to html --no-input try.ipynb!jupyter nbconvert --to html --no-input --template basic --output try.html try.ipynb我仍在探索使用這些小部件,但我被困在這里。
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關(guān)注
  • 120 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號