This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # taken from | |
| # http://blindvic.blogspot.be/2010/12/frozen-column-example-pyqt4-python3.html | |
| # conversion to qtpy, russian comments removal and a few minor improvements done by Gaëtan de Menten | |
| # That blog post was itself inspired from | |
| # http://python.su/forum/viewtopic.php?id=7346 | |
| # see also | |
| # http://objexx.com/labs.Efficient-Qt-Frozen-Columns-and-Rows.html | |
| # to make it more efficient for large tables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <title>Sandbox</title> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> | |
| <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> | |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import polars as pl | |
| def lazy_pivot(lf, on, index, values, aggregate_function=None, maintain_order=True): | |
| on = pl.col(on) | |
| index = pl.col(index) | |
| values = pl.col(values) | |
| unq_values = lf.select(on).unique(maintain_order=maintain_order).collect(engine='streaming').to_series().to_list() | |
| if aggregate_function is None: | |
| # FIXME: this does not replicate eager pivot default value which raises when there are several values in a cell | |
| aggregate_function = 'first' |
OlderNewer