1234567891011121314151617181920212223242526 |
- #!/usr/bin/env python
- # -*- encoding: utf-8 -*-
- """
- @Contact : liuyuqi.gov@msn.cn
- @Time : 2024/06/04
- @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
- @Desc : pygwalker 作图
- """
- from ast import main
- import pygwalker as pw
- import gradio as gr
- from datasets imoprt load_dataset
- dataset = load_dataset("gradio/NYC-Airbnb-Open-Data", split="train")
- df = dataset.to_pandas()
- with gr.Blocks() as demo:
- gr.Label("在 PyGWalker 和 Gradio 中可视化探索 NYC-Airbnb 数据")
- gr.Markdown("这是一个使用 pygwalker 和 gradio 库构建的数据应用程序。您可以使用拖放操作来探索数据。现在开始您的分析吧!")
- gr.HTML(pw.walk(dataset=df, spec="./viz-config.json", debug=False, return_html=True))
- if __name__=='__main__':
- demo.launch()
|