浏览代码

#557 add documentation

Falko Schindler 2 年之前
父节点
当前提交
b8a44c7fe0
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      website/more_documentation/aggrid_documentation.py

+ 10 - 0
website/more_documentation/aggrid_documentation.py

@@ -89,3 +89,13 @@ def more() -> None:
                 {'name': 'Carol', 'age': 42},
             ],
         }).classes('max-h-40')
+
+    @text_demo('Create Grid from Pandas Dataframe', '''
+        You can create an AG Grid from a Pandas Dataframe using the `from_pandas` method.
+        This method takes a Pandas Dataframe as input and returns an AG Grid.
+    ''')
+    def aggrid_from_pandas():
+        import pandas as pd
+
+        df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]})
+        ui.aggrid.from_pandas(df).classes('max-h-40')