Spaces:
Running
Running
Debajyoti Debnath
commited on
Commit
·
7c8994a
1
Parent(s):
5a60aba
Move imports to bottom and add URL for DRY
Browse files- polars/08_working_with_columns.py +11 -11
- polars/09_data_types.py +7 -8
polars/08_working_with_columns.py
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
|
| 9 |
import marimo
|
| 10 |
|
| 11 |
-
__generated_with = "0.
|
| 12 |
app = marimo.App(width="medium")
|
| 13 |
|
| 14 |
|
|
@@ -26,15 +26,6 @@ def _(mo):
|
|
| 26 |
return
|
| 27 |
|
| 28 |
|
| 29 |
-
@app.cell
|
| 30 |
-
def _():
|
| 31 |
-
import csv
|
| 32 |
-
import marimo as mo
|
| 33 |
-
import polars as pl
|
| 34 |
-
from io import StringIO
|
| 35 |
-
return StringIO, csv, mo, pl
|
| 36 |
-
|
| 37 |
-
|
| 38 |
@app.cell(hide_code=True)
|
| 39 |
def _(mo):
|
| 40 |
mo.md(
|
|
@@ -64,7 +55,7 @@ def _(mo):
|
|
| 64 |
r"""
|
| 65 |
## Expression expansion
|
| 66 |
|
| 67 |
-
Expression expansion lets you write a single expression that can expand to multiple different expressions. So rather than repeatedly defining separate expressions, you can avoid redundancy while adhering to clean code principles (Do not Repeat Yourself - DRY). Since expressions are reusable, they aid in writing concise code.
|
| 68 |
"""
|
| 69 |
)
|
| 70 |
return
|
|
@@ -601,5 +592,14 @@ def _(mo):
|
|
| 601 |
return
|
| 602 |
|
| 603 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
if __name__ == "__main__":
|
| 605 |
app.run()
|
|
|
|
| 8 |
|
| 9 |
import marimo
|
| 10 |
|
| 11 |
+
__generated_with = "0.12.0"
|
| 12 |
app = marimo.App(width="medium")
|
| 13 |
|
| 14 |
|
|
|
|
| 26 |
return
|
| 27 |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
@app.cell(hide_code=True)
|
| 30 |
def _(mo):
|
| 31 |
mo.md(
|
|
|
|
| 55 |
r"""
|
| 56 |
## Expression expansion
|
| 57 |
|
| 58 |
+
Expression expansion lets you write a single expression that can expand to multiple different expressions. So rather than repeatedly defining separate expressions, you can avoid redundancy while adhering to clean code principles (Do not Repeat Yourself - [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)). Since expressions are reusable, they aid in writing concise code.
|
| 59 |
"""
|
| 60 |
)
|
| 61 |
return
|
|
|
|
| 592 |
return
|
| 593 |
|
| 594 |
|
| 595 |
+
@app.cell(hide_code=True)
|
| 596 |
+
def _():
|
| 597 |
+
import csv
|
| 598 |
+
import marimo as mo
|
| 599 |
+
import polars as pl
|
| 600 |
+
from io import StringIO
|
| 601 |
+
return StringIO, csv, mo, pl
|
| 602 |
+
|
| 603 |
+
|
| 604 |
if __name__ == "__main__":
|
| 605 |
app.run()
|
polars/09_data_types.py
CHANGED
|
@@ -26,13 +26,6 @@ def _(mo):
|
|
| 26 |
return
|
| 27 |
|
| 28 |
|
| 29 |
-
@app.cell
|
| 30 |
-
def _():
|
| 31 |
-
import marimo as mo
|
| 32 |
-
import polars as pl
|
| 33 |
-
return mo, pl
|
| 34 |
-
|
| 35 |
-
|
| 36 |
@app.cell(hide_code=True)
|
| 37 |
def _(mo):
|
| 38 |
mo.md(
|
|
@@ -277,7 +270,6 @@ def _(pl):
|
|
| 277 |
return
|
| 278 |
|
| 279 |
|
| 280 |
-
|
| 281 |
@app.cell(hide_code=True)
|
| 282 |
def _(mo):
|
| 283 |
mo.md(
|
|
@@ -290,5 +282,12 @@ def _(mo):
|
|
| 290 |
return
|
| 291 |
|
| 292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
if __name__ == "__main__":
|
| 294 |
app.run()
|
|
|
|
| 26 |
return
|
| 27 |
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
@app.cell(hide_code=True)
|
| 30 |
def _(mo):
|
| 31 |
mo.md(
|
|
|
|
| 270 |
return
|
| 271 |
|
| 272 |
|
|
|
|
| 273 |
@app.cell(hide_code=True)
|
| 274 |
def _(mo):
|
| 275 |
mo.md(
|
|
|
|
| 282 |
return
|
| 283 |
|
| 284 |
|
| 285 |
+
@app.cell(hide_code=True)
|
| 286 |
+
def _():
|
| 287 |
+
import marimo as mo
|
| 288 |
+
import polars as pl
|
| 289 |
+
return mo, pl
|
| 290 |
+
|
| 291 |
+
|
| 292 |
if __name__ == "__main__":
|
| 293 |
app.run()
|