You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ A module to display Pandas DataFrames in Textual's DataTable widget.
4
4
5
5
## Background
6
6
7
-
Pandas is a popular Python library for data analysis. One of the core components to Pandas is the DataFrame object. A DataFrame is a two-dimensional data structure that represents data in rows and columns.
7
+
Pandas is a popular Python library for data analysis. One of the core components of Pandas is the DataFrame object. A DataFrame is a two-dimensional data structure that represents data in rows and columns.
8
8
9
-
Given Pandas DataFrames are tabular in nature, it makes sense to be able to render them in Textual using the DataTable widget.
9
+
Given Pandas DataFrames are tabular in nature, it makes sense to be able to render them in Textual using the DataTable widget. Enter the DataFrameTable widget...
10
10
11
11
## Installation
12
12
@@ -26,7 +26,7 @@ First, you'll need to import the `DataFrameTable` widget.
26
26
from textual_pandas.widgets import DataFrameTable
27
27
```
28
28
29
-
After importing the widget, you'll need to yield the `DataFrameTable` widget in your app's `compose()` method (like you would with the DataTable widget). Once you're ready to draw the table with your DataFrame data (most likely `on_mount()`), you'll simply call the `add_df()` method and pass in a DataFrame object.
29
+
After importing the widget, you'll need to yield the `DataFrameTable` widget in your Textual app's `compose()` method (like you would with the DataTable widget). Once you're ready to draw the table with your DataFrame data (most likely `on_mount()`), you'll simply call the `add_df()` method and pass in a Pandas DataFrame.
30
30
31
31
```python
32
32
from textual.app import App
@@ -48,13 +48,13 @@ class ClassApp(App):
48
48
table.add_df(df)
49
49
```
50
50
51
-
That's it! Now you're DataFrame will display within a DataTable widget!
51
+
That's it! Now your DataFrame will display within a DataTable widget!
52
52
53
53
### Updating the DataFrame
54
54
55
-
If you update your DataFrame and would like to see the updates in your app, then you'll need to use the `update_df` method and pass in your updated DataFrame object.
55
+
If you update your DataFrame, and would like to see the updates in your app, then you'll need to use the `update_df()` method and pass in your updated DataFrame object.
56
56
57
-
If you only want to update the rendered DataTable (without the need to change the DataFrame), you may also use the `update_cell` and `update_cell_at` methods that are provided by the DataTable widget.
57
+
If you only want to update the rendered DataFrameTable (without the need to change the DataFrame), you may also use the `update_cell()` and `update_cell_at()` methods that are provided by the DataTable widget.
0 commit comments