|
40 | 40 | ;; ## The Vision |
41 | 41 |
|
42 | 42 | ;; Imagine being able to: |
| 43 | + |
43 | 44 | ;; - Write Python data science code in your browser |
44 | 45 | ;; - Visualize data with matplotlib without any backend |
45 | 46 | ;; - Process data with pandas entirely client-side |
|
51 | 52 | ;; ## What is Pyodide? |
52 | 53 |
|
53 | 54 | ;; [Pyodide](https://pyodide.org/) is a Python distribution compiled to WebAssembly that runs entirely in the browser. It includes: |
| 55 | + |
54 | 56 | ;; - Full Python 3.11 interpreter |
55 | 57 | ;; - NumPy, Pandas, Matplotlib, SciPy |
56 | 58 | ;; - 100+ scientific packages |
|
64 | 66 | ;; Let's start with the simplest possible example - loading Pyodide and running Python code. |
65 | 67 |
|
66 | 68 | ;; The demo below shows a basic Python REPL where you can: |
| 69 | + |
67 | 70 | ;; - Load Pyodide from CDN |
68 | 71 | ;; - Execute Python expressions |
69 | 72 | ;; - See results instantly |
|
116 | 119 | ;; Now for the exciting part - creating beautiful data visualizations with Python's matplotlib library! |
117 | 120 |
|
118 | 121 | ;; The demo below captures matplotlib plots as base64 PNG images and displays them inline. This technique: |
| 122 | + |
119 | 123 | ;; - Uses matplotlib's non-interactive 'Agg' backend |
120 | 124 | ;; - Captures plots as PNG data |
121 | 125 | ;; - Displays high-quality visualizations |
|
136 | 140 | ;; ### Why Pandas in the Browser? |
137 | 141 |
|
138 | 142 | ;; Pandas is the standard tool for data analysis in Python. With Pyodide, you can: |
| 143 | + |
139 | 144 | ;; - Load and manipulate tabular data |
140 | 145 | ;; - Perform statistical analysis |
141 | 146 | ;; - Filter, group, and transform datasets |
142 | 147 | ;; - All without a backend server! |
143 | 148 |
|
144 | 149 | ;; The demo includes examples of: |
| 150 | + |
145 | 151 | ;; - **Creating DataFrames** - Build tables from Python dictionaries |
146 | 152 | ;; - **Statistical Analysis** - Summary statistics and correlations |
147 | 153 | ;; - **Data Transformations** - Filter, calculate, sort, and rank |
|
162 | 168 | ;; ### Why Combine Them? |
163 | 169 |
|
164 | 170 | ;; In real-world data science, you rarely use just one tool. You: |
| 171 | + |
165 | 172 | ;; 1. **Load and clean data** with Pandas |
166 | 173 | ;; 2. **Analyze and transform** to extract insights |
167 | 174 | ;; 3. **Visualize results** with Matplotlib |
|
170 | 177 | ;; ### Complete Workflow Examples |
171 | 178 |
|
172 | 179 | ;; **Sales Trend Analysis:** |
| 180 | + |
173 | 181 | ;; - Load monthly sales data into DataFrame |
174 | 182 | ;; - Calculate profit and margins |
175 | 183 | ;; - Generate statistical summary |
176 | 184 | ;; - Create trend lines and bar charts |
177 | 185 | ;; - Display both tables and visualizations |
178 | 186 |
|
179 | 187 | ;; **Product Performance:** |
| 188 | + |
180 | 189 | ;; - Analyze product sales across quarters |
181 | 190 | ;; - Aggregate by product category |
182 | 191 | ;; - Compare units sold and revenue |
183 | 192 | ;; - Show horizontal and vertical bar charts |
184 | 193 |
|
185 | 194 | ;; **Regional Breakdown:** |
| 195 | + |
186 | 196 | ;; - Multi-dimensional analysis by region and quarter |
187 | 197 | ;; - Create pivot tables |
188 | 198 | ;; - Generate 4 different chart types |
189 | 199 | ;; - Display comprehensive dashboard |
190 | 200 |
|
191 | 201 | ;; **Time Series Analysis:** |
| 202 | + |
192 | 203 | ;; - 90 days of daily sales data |
193 | 204 | ;; - Calculate 7-day and 30-day moving averages |
194 | 205 | ;; - Aggregate to monthly totals |
|
224 | 235 | ;; ## Next Steps |
225 | 236 |
|
226 | 237 | ;; Explore more advanced features: |
| 238 | + |
227 | 239 | ;; - Advanced pandas operations (joins, pivots, time series) |
228 | 240 | ;; - Interactive data exploration with dynamic filtering |
229 | 241 | ;; - Machine learning with scikit-learn |
|
0 commit comments