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
## 📝 Summary
<!--
Provide a concise summary of what this pull request is addressing.
If this PR fixes any issues, list them here by number (e.g., Fixes#123).
-->
- Use polars instead of pandas
- Altair instead of pyplot
- Add a short sql cell guide (don't return df, pass in engine name)
## 🔍 Description of Changes
<!--
Detail the specific changes made in this pull request. Explain the
problem addressed and how it was resolved. If applicable, provide before
and after comparisons, screenshots, or any relevant details to help
reviewers understand the changes easily.
-->
## 📋 Checklist
- [x] I have read the [contributor
guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md).
- [ ] For large changes, or changes that affect the public API: this
change was discussed or approved through an issue, on
[Discord](https://marimo.io/discord?ref=pr), or the community
[discussions](https://github.com/marimo-team/marimo/discussions) (Please
provide a link if applicable).
- [x] I have added tests for the changes made.
- [x] I have run the code and verified that it works as expected.
Copy file name to clipboardExpand all lines: docs/_static/CLAUDE.md
+65-44Lines changed: 65 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ Marimo's reactivity means:
46
46
47
47
<data_handling>
48
48
49
-
- Use pandas for data manipulation
49
+
- Use polars for data manipulation
50
50
- Implement proper data validation
51
51
- Handle missing values appropriately
52
52
- Use efficient data structures
@@ -56,7 +56,7 @@ Marimo's reactivity means:
56
56
<visualization>
57
57
- For matplotlib: use plt.gca() as the last expression instead of plt.show()
58
58
- For plotly: return the figure object directly
59
-
- For altair: return the chart object directly
59
+
- For altair: return the chart object directly. Add tooltips where appropriate. You can pass polars dataframes directly to altair.
60
60
- Include proper labels, titles, and color schemes
61
61
- Make visualizations interactive where appropriate
62
62
</visualization>
@@ -79,7 +79,7 @@ Marimo's reactivity means:
79
79
</data_sources>
80
80
81
81
<sql>
82
-
- When writing duckdb, prefer using marimo's SQL cells, which start with _df = mo.sql(query)
82
+
- When writing duckdb, prefer using marimo's SQL cells, which start with df = mo.sql(f"""<yourquery>""") for DuckDB, or df = mo.sql(f"""<yourquery>""", engine=engine) for other SQL engines.
83
83
- See the SQL with duckdb example for an example on how to do this
84
84
- Don't add comments in cells that use mo.sql()
85
85
- Consider using \`vega_datasets\` for common example datasets
@@ -132,7 +132,8 @@ Common issues and solutions:
132
132
<exampletitle="Basic UI with reactivity">
133
133
# Cell 1
134
134
import marimo as mo
135
-
import matplotlib.pyplot as plt
135
+
import altair as alt
136
+
import polars as pl
136
137
import numpy as np
137
138
138
139
# Cell 2
@@ -151,59 +152,64 @@ n_points # Display the slider
151
152
x = np.random.rand(n_points.value)
152
153
y = np.random.rand(n_points.value)
153
154
154
-
plt.figure(figsize=(8, 6))
155
-
plt.scatter(x, y, alpha=0.7)
156
-
plt.title(f"Scatter plot with {n_points.value} points")
157
-
plt.xlabel("X axis")
158
-
plt.ylabel("Y axis")
159
-
plt.gca() # Return the current axes to display the plot
0 commit comments