pandaswidgets
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| CornerCellDelegate cutepandas.pandaswidgets._viewer_style Renderer for the top-left level-name corner table of the grid viewer. |
||
| DataCellDelegate cutepandas.pandaswidgets._viewer_style Clean cell renderer: horizontal padding, muted null marker, no dotted focus. |
||
| HeaderCellDelegate cutepandas.pandaswidgets._viewer_style Renderer for the multi-level column and row header tables. |
||
| ViewerColors cutepandas.pandaswidgets._viewer_style Cohesive color tokens derived from a QPalette (works in light & dark themes). |
Re-exported classes¶
| Class | Module | Description |
|---|---|---|
| ColumnProfileWidget | cutepandas.pandaswidgets.columnprofilewidget | Basic statistics and the most frequent values of one column of any frame. |
| DataFrameListWidget | cutepandas.pandaswidgets.dataframelistwidget | |
| DataFrameManagerWidget | cutepandas.pandaswidgets.dataframemanagerwidget | |
| DataFrameViewer | cutepandas.pandaswidgets.dataframeviewer | Data table with synced column / index headers (MultiIndex spans for pandas). |
| DataFrameWidget | cutepandas.pandaswidgets.dataframewidget | Viewer plus docks: index levels, columns, categories, column profile, attrs. |
| GridDataFrameViewer | cutepandas.pandaswidgets.gridviewer | Four-table 2x2 grid viewer with flush corner, column header, index, and data. |
| SimpleDataFrameViewer | cutepandas.pandaswidgets.simpledataframeviewer | Lightweight single-table viewer backed by DataFrameModel. |
| TopValuesModel | cutepandas.pandaswidgets.columnprofilewidget | Most frequent values of a column: value, count and share of all rows. |
🛈 DocStrings¶
pandaswidgets module.
Widgets for dataframes (pandas first; most also show polars and pyarrow frames).
ColumnProfileWidget
¶
Bases: TranslateMixin, Widget
Basic statistics and the most frequent values of one column of any frame.
Shows dtype, row / null / unique counts, min / max / mean / std and the top values with a share bar.
set_column() computes the statistics right away (FrameSource.describe, a full
column scan). For large frames compute them in a worker thread and pass the
result to set_stats(), which must run on the GUI thread.
The field labels (FIELDS) and the top values header go through translate
(str -> str, e.g. gettext); set_translate() / retranslate() switch the
language at runtime (see cutepandas.utils.i18n).
Source code in src/cutepandas/pandaswidgets/columnprofilewidget.py
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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | |
retranslate
¶
Re-show the labels with the current translate callable.
Source code in src/cutepandas/pandaswidgets/columnprofilewidget.py
set_column
¶
Profile a column (position or label) of a frame, source or holder.
Source code in src/cutepandas/pandaswidgets/columnprofilewidget.py
set_stats
¶
set_stats(info: ColumnInfo, stats: ColumnStats)
Show precomputed statistics (GUI thread).
Source code in src/cutepandas/pandaswidgets/columnprofilewidget.py
DataFrameManagerWidget
¶
Bases: Splitter
Source code in src/cutepandas/pandaswidgets/dataframemanagerwidget.py
DataFrameViewer
¶
Bases: SortableViewerMixin, Widget
Data table with synced column / index headers (MultiIndex spans for pandas).
Clicking a column header emits sort_requested(column, order) (order is a
Qt.SortOrder; clicking the same column again reverses it). With
sortable=True (default) the viewer then sorts itself, see sort_mode; with
sortable=False it only emits the signal, so an application can sort under its
own control (e.g. a memory budget) and call set_df() / set_sort_state().
sort_mode="copy" (default) replaces the frame by a sorted copy (on the GUI
thread); sort_mode="permutation" sorts for display only (a row order of 8 bytes
per row in the holder, no frame copy). The order is computed in a worker thread:
sorting_changed(True) while it runs, sorting_changed(False) when it was
applied or dropped. Only the latest request is applied, and only if the frame
was not replaced or edited meanwhile; cancel_sort() drops a running one.
See DataFrameModel.
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 | |
__init__
¶
__init__(
df: Any = None,
*,
sortable: bool = True,
sort_mode: SortMode = "copy",
dtype_icons: bool = True,
**kwargs,
) -> None
Pass a DataFrameHolder to share the frame with other models / widgets.
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |
auto_size_column
¶
Set the size of column at column_index to fit its contents.
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
auto_size_row
¶
Set the size of row at row_index to fix its contents.
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
jump_to_column
¶
Make sure column at given index is visible.
Scrolls to column at given index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_num
|
int
|
column to scroll to |
required |
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
on_clicked
¶
Request a sort by the clicked leaf column; clicking again reverses.
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
set_df
¶
showEvent
¶
Initialize column and row sizes on the first time the widget is shown.
Source code in src/cutepandas/pandaswidgets/dataframeviewer.py
DataFrameWidget
¶
Bases: TranslateMixin, MainWindow
Viewer plus docks: index levels, columns, categories, column profile, attrs.
Shows pandas, pyarrow and polars frames. For pandas frames the column and category lists edit the frame (rename, dtype, reorder, ...); for other backends they are read-only and the index list stays empty.
Dock titles and the labels of the panels go through translate (str -> str);
set_translate() / retranslate() switch the language at runtime.
Source code in src/cutepandas/pandaswidgets/dataframewidget.py
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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | |
retranslate
¶
Re-show dock titles and panel labels with the current translate.
Source code in src/cutepandas/pandaswidgets/dataframewidget.py
GridDataFrameViewer
¶
Bases: SortableViewerMixin, Widget
Four-table 2x2 grid viewer with flush corner, column header, index, and data.
Layout
table_level | table_header | (corner) table_index | table_data | vscroll | hscroll |
Because table_level occupies the top-left quadrant with the exact height of
table_header and exact width of table_index, headers sit completely flush
against table_data with no spacer gaps — even when both row and column
MultiIndexes have level names.
Source code in src/cutepandas/pandaswidgets/gridviewer.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 | |
auto_size_column
¶
Fit column_index in both table_header and table_data.
Source code in src/cutepandas/pandaswidgets/gridviewer.py
jump_to_column
¶
Scroll horizontally so col_num is visible.
Source code in src/cutepandas/pandaswidgets/gridviewer.py
SimpleDataFrameViewer
¶
Bases: SortableViewerMixin, TableView
Lightweight single-table viewer backed by DataFrameModel.
Uses Qt's native horizontal and vertical QHeaderViews (joining MultiIndex
levels with a separator) instead of separate header tables. Supports shared
DataFrameHolders, dtype icons, clipboard copy/paste, and both "copy" and
"permutation" sort modes with native sort indicators.
Source code in src/cutepandas/pandaswidgets/simpledataframeviewer.py
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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
auto_size_column
¶
Fit column_index to its header (including icon/sort arrow) and first rows.
Source code in src/cutepandas/pandaswidgets/simpledataframeviewer.py
copy
¶
Copy the bounding box of the selected cells as tab-separated text.
Source code in src/cutepandas/pandaswidgets/simpledataframeviewer.py
paste
¶
Paste tab-separated clipboard text, starting at the current cell.
Source code in src/cutepandas/pandaswidgets/simpledataframeviewer.py
TopValuesModel
¶
Bases: TranslatableHeaderMixin, AbstractTableModel
Most frequent values of a column: value, count and share of all rows.