-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathdata-explorer-data-grid.qmd
More file actions
105 lines (56 loc) · 7.44 KB
/
data-explorer-data-grid.qmd
File metadata and controls
105 lines (56 loc) · 7.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
title: "Data Grid"
description: "View millions of rows and columns in Positron's efficient Data Explorer, with real-time updates and support for Pandas, Polars, tibbles, and database connections."
---
The data grid is the primary display, with a spreadsheet-like cell-by-cell view. It's intended to scale efficiently to relatively large in-memory datasets, up to millions of rows or columns.
{width=700 fig-alt="Data grid displaying flight data for January 1, 2013, with columns for year, month, day, dep_time, sched_dep_tim, and dep_delay."}
Each Data Explorer instance watches the underlying data for changes, so if you edit a data file or modify an in-memory dataframe, the changes will be reflected in the Data Explorer.
### Supported data frame libraries
Pandas and Polars dataframe objects are supported in Python, and `data.frame`, `tibble`, and `data.table` are supported in R. Previews of database connections managed by the [**Connections** pane](connections-pane.qmd) are also supported, for both Python and R.
Based on [user feedback](feedback.qmd#feedback-and-issues), we may add support for other libraries that expose a tabular data interface.
### Column overview
Each column header has the column name above the data type, which is dependent on the backend type (language runtime or DuckDB).
At the top right of each column, there is a context menu for column specific actions.
{width=300 fig-alt="Data explorer column dropdown menu open, showing options: Copy Column, Select Column, Pin Column, Sort Ascending, Sort Descending, Clear Sorting, and Add Filter."}
Columns can be resized by selecting and dragging the border on either side of a column.
### Row overview
Row labels default to the observed row index, with a zero-based index in Python and a one-based index in R. Alternatively, `pandas` and R users may also have rows with modified indices or string-based labels.
Right-clicking on a row header will bring up a context menu for row specific actions.
{width=300 fig-alt="Data explorer row right-click menu open, showing options: Copy Row, Select Row, and Pin Row."}
### Cell overview
For long strings or other data values that do not fully fit in a grid cell, you can see a tooltip containing the complete value by hovering over the cell:
{width=300 fig-alt="Data explorer cell showing '2013-01-01 0...'. A highlighted row with an expanded view displays '2013-01-01 05:00:00.'"}
Right-clicking or pressing {{< kbd mac=Shift-F10 win=Shift-F10 linux=Shift-F10 >}} on a cell will bring up a context menu for cell specific actions.
{width=300 fig-alt="Data explorer row right-click menu open, showing options: Copy, Select Column, Select Row, Pin Column, Pin Row, Sort Ascending, Sort Descending, Clear Sorting, and Add Filter."}
When focused on a cell you can bring up the row header menu by pressing {{< kbd mac=Option-Shift-F10 win=Alt-Shift-F10 linux=Alt-Shift-F10 >}}. You can bring up the column header menu by pressing {{< kbd mac=Ctrl-Shift-F10 win=Ctrl-Shift-F10 linux=Ctrl-Shift-F10 >}}
## Sorting
To sort the values in a column, open a column context menu from the top of the grid and select either **Sort Ascending** or **Sort Descending**.
{width=300 fig-alt="Data explorer column dropdown menu open, showing options: Copy Column, Select Column, Pin Column, Sort Ascending, Sort Descending, Clear Sorting, and Add Filter."}
To clear an individual column sort, select the column header and choose **Clear Sorting** from the context menu.
When a column is sorted, the column header displays an arrow pointing up or down to indicate the sort direction. You can sort by multiple columns by opening the context menu for a second column and sorting it as well. The number next to the sort direction indicates the sort order of the column.
{width=400 fig-alt="Data Explorer displaying two columns, 'dep_time' with 1.00 values and 'sched_dep_time' showing 2359. Arrows next to column name indicate sorting ascending or descending. Numbers next to arrows indicate order of sort."}
To clear all sorting, select the **Clear Column Sorting** button in the top action bar.
## Pinning columns and rows
You can pin columns and rows to keep them visible while scrolling through large datasets. Pinned columns appear on the left side of the grid, and pinned rows appear at the top.
### Pin columns
To pin a column, right-click the column header and select **{{< fa thumbtack >}} Pin Column** from the context menu. The column moves to the left side of the grid and remains visible when you scroll horizontally.
To unpin a column, right-click the pinned column header and select **{{< fa thumbtack-slash >}} Unpin Column** from the context menu.
### Pin rows
To pin a row, right-click the row header and select **{{< fa thumbtack >}} Pin Row** from the context menu. The row moves to the top of the grid and remains visible when you scroll vertically.
To unpin a row, right-click the pinned row header and select **{{< fa thumbtack-slash >}} Unpin Row** from the context menu.
### Pin multiple items
You can pin multiple columns and rows. Pinned columns appear in the order you pin them, starting from the leftmost position. Pinned rows appear in the order you pin them, starting from the top.
## Selection, copy, and paste
The data grid provides copy-and-paste capabilities similar to a spreadsheet. You can select:
* A single cell
* A rectangular range of cells
* One or more rows
* One or more columns
To copy a single value, select a cell and press {{< kbd mac=Command-C win=Ctrl-C linux=Ctrl-C >}}. You can also copy the value using the right-click context menu.
To copy a rectangular range of cells, select a cell, then hold {{< kbd Shift >}} and select another cell to define the range. Press {{< kbd mac=Command-C win=Ctrl-C linux=Ctrl-C >}} or use the context menu to copy the values.
{fig-alt="Data grid showing a rectangular selection of cells highlighted in blue, spanning multiple rows and columns of numeric data." width=500}
When you copy a rectangular range of cells, the system copies the values with column names in tab-separated format. This format makes pasting into Excel or Google Sheets easier.
To copy entire rows or columns, select the first row label or column label. Then either hold {{< kbd Shift >}} and select another row or column label to define a range, or hold {{< kbd mac=Command win=Ctrl linux=Ctrl >}} and select additional labels to choose individual rows or columns.
{fig-alt="Data grid showing multiple entire rows selected and highlighted in blue, with row numbers visible on the left." width=500}
{fig-alt="Data grid showing multiple entire columns selected and highlighted in blue, with column headers visible at the top." width=500}
When you copy entire rows or columns, the system includes column names in the tab-separated output, similar to copying a rectangular range of cells.