# /// script
# dependencies = [
# "marimo",
# "anywidget==0.9.13",
# "traitlets==5.14.3",
# ]
# ///
"""
This is the starting point for your notebook.
"""
import marimo
__generated_with = "0.9.10"
app = marimo.App()
@app.cell(hide_code=True)
def __(header_widget):
header_widget
return
@app.cell(hide_code=True)
def __(mo):
mo.md(
r"""
First of all, create a header for your notebook.
We've designed a `HeaderWidget` for you to display important information.
To use `HeaderWidget`, you need to create an instance of it. You can pass a dictionary containing key-value pairs that represent the information you want to display in the header.
For example:
```python
header_widget = HeaderWidget(
result={
"Title": "Comprehensive E-Commerce Customer Behavior Analysis",
"Author": 'Dr. Jane Smith, PhD',
"Version": "1.2.3",
"Description": "This advanced notebook presents a multi-faceted analysis of customer behavior patterns across various e-commerce platforms. The primary goal is to derive actionable insights that can significantly enhance customer engagement, optimize conversion rates, and ultimately drive business growth in the competitive e-commerce landscape.",
"Keywords": "E-Commerce Analytics, Customer Behavior Modeling, Predictive Analytics, Machine Learning, Natural Language Processing, Data Visualization, Time Series Analysis",
"Data Sources": "1. Customer transaction logs (5 years, 10M+ records)
2. Website clickstream data (real-time, 1B+ events)
3. CRM records (customer demographics, purchase history)
4. Social media interactions (Twitter, Facebook, Instagram)
5. Customer support tickets and chat logs
6. Product catalog and inventory data",
"Last Updated": "November 3, 2024",
}
)
```
"""
)
return
@app.cell(hide_code=True)
def __(mo):
mo.md(
r"""
**Some tips from our experience with marimo**
1. If a notebook contains any io operation, e.g., reading an external .csv file, you'd better use a `marimo.ui.form` for users to config the path of this .csv file.
2. You can create more ui components and appealing contents with pure html, [anywidget](https://github.com/manzt/anywidget) and more. But when you are doing this, remember to check its appearance under both light and dark themes, and different widths.
3. Albeit you can create local variables in a cell with a prefix "_", we recommend you do this as little as possible because the `Explore variables` panel will neglect these variables, making debug these variables hard.
4. If you want your notebook to run properly in our cloud, please check whether the dependencies are supported by wasm. Some popular libraries like `polars` and `openai`, for example, are not supported.
5. Attach as few assets as possible, we want to keep our repo lightweight.
6. Functional thinking are preferred in marimo since instances are immutable.
"""
).callout(kind="info")
return
@app.cell(hide_code=True)
def __(mo):
# Custom Constants
custom_form = (
mo.md(
r"""
**Customize your constants here:**
{image}
"""
)
.batch(
image=mo.ui.text(
value="../assets/<>/<>",
label="Path of your data: ",
full_width=True,
), ## add more rows below
)
.form(bordered=True, label="Custom Constants")
)
custom_form
return (custom_form,)
@app.cell(hide_code=True)
def __(mo):
mo.md(
r"""
You can access the value of the form above with:
```python
custom_form.value['image']
```
after the submission.
"""
).callout(kind="info")
return
@app.cell(hide_code=True)
def __(mo):
mo.md(
"""