Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Dr. Shahin Rostami

Rating No ratings yet

A practical book on Data Analysis with Rust Notebooks that teaches you the concepts and how they’re implemented in practice.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide for data scientists and Rust developers who want to run interactive data analysis in Jupyter Notebooks using the EvCxR kernel, covering everything from environment setup to plotting and array manipulation with practical, notebook-first examples. 【Book Arc】 - **Opening (~0%–10%)**: The author introduces Rust's ownership model and memory safety as motivation, then walks through installing Miniconda, Jupyter Lab, Rust 1.42.0, and the EvCxR Jupyter kernel—establishing the complete toolchain for notebook-based Rust development. - **Early (~10%–23%)**: Plotting begins with Plotters for simple figures, then shifts to Plotly via a workaround that saves HTML files; the author identifies limitations like large file sizes (3.4 MB) and single-plot output, setting up the need for a better solution. - **Early (~23%–32%)**: The Plotly workaround is refined by generating unique IDs with `nanoid` and wrapping JavaScript in `require` blocks, enabling multiple plots per notebook while slashing file size to 16 KB—a key technical breakthrough. - **Middle (~39%–48%)**: The `darn` crate consolidates the Plotly workaround into a reusable `show_plot()` function, then introduces `ndarray` for multidimensional arrays (creation, indexing, math operations), with `darn::show_array()` improving 2D array display in notebooks. - **Late (~48%–end)**: The book moves toward practical data analysis, covering CSV dataset loading into `ndarray` containers, though the excerpts do not cover the full scope of analysis techniques or machine learning applications promised in the preface. 【Key Takeaways】 - **Rust's ownership model ensures memory and thread safety at compile time** (Opening): The borrow checker prevents undefined behavior like dangling pointers, making Rust reliable for data-heavy tasks; this is the core motivation for using Rust over memory-managed languages. - **EvCxR enables interactive Rust in Jupyter Notebooks** (Opening): Installing the kernel via `cargo install evcxr_jupyter` and running `jupyter lab` allows code execution in cells, though the author notes it's enjoyable but not always ideal for production workflows. - **Plotters offers simple, inline plotting for notebooks** (Early): Using `evcxr_figure` with the Plotters crate renders charts directly in cells, suitable for basic visualizations like line series, but lacks the interactivity of Plotly. - **Plotly integration requires a workaround for notebook rendering** (Early): The `to_html()` function saves plots to files, but loading them back creates large notebooks (3.4 MB) and limits output to a single plot due to duplicate HTML IDs. - **Unique IDs and JavaScript wrapping enable multiple Plotly plots** (Early): Replacing the fixed `plotly-html-element` ID with `nanoid`-generated values and wrapping scripts in `require(["plotly"], ...)` allows multiple plots per notebook, reducing file size to 16 KB. - **The `darn` crate packages the Plotly workaround for reuse** (Middle): Functions like `darn::show_plot()` and `darn::show_array()` streamline visualization and array display, making notebook output cleaner and more professional. - **`ndarray` provides numpy-like functionality in Rust** (Middle): Creating arrays with `arr2()`, `array!`, `zeros()`, and `ones()`, plus indexing and element-wise operations, gives Rust data scientists a familiar toolkit for numerical work. - **CSV loading into `ndarray` is the gateway to real analysis** (Late): The book transitions from setup and visualization to loading datasets, though the excerpts do not detail the full analysis pipeline or machine learning applications. 【Reading Tips】 - **Skim the setup sections if you're experienced** (~0%–10%): The installation steps for Miniconda, Rust, and EvCxR are straightforward; focus on the EvCxR kernel installation and PATH configuration if you're new to Rust notebooks. - **Deep-read the Plotly workaround chapters** (~23%–32%): The `nanoid` and `require` wrapping techniques are the book's most valuable technical insights—understand the HTML/JavaScript manipulation to appreciate the `darn` crate's design. - **Practice with `ndarray` examples** (~39%–48%): The array creation and operation snippets are quick to run in notebooks; experiment with indexing and math operations to build muscle memory before tackling datasets. - **Watch for version-specific instructions**: The book pins Rust 1.42.0 and specific crate versions (e.g., `evcxr_jupyter 0.5.3`), so expect to adapt commands if you're using newer versions—check the `darn` crate documentation for updates. - **Take away the notebook-first workflow**: The author emphasizes literate programming (intertwining narrative, code, and output); adopt this approach for your own projects to create reproducible, readable analyses. 【Coverage Limits】 This guide covers the book's setup, visualization, and array manipulation sections; the excerpts do not include the full data analysis techniques, machine learning algorithms, or search/optimization experiments mentioned in the preface, so those remain unexplored here.
Page 6
rameters[i]); } let h = 1_f32 - (f1 / g).sqrt(); let f2 = g * h; return [f1, f2]; } It was interesting to see that since writing this code in 2016, some of m...
View in text
Excerpt 2
nsed to yz@mtx.gg on 18th January 2022 Plotting with Plotly let trace1 = Scatter::new(vec![1, 2, 3, 4], vec![10, 15, 13, 17]) .name("trace1") .mode(Mode::Mar...
View in text
Excerpt 3
(gd,{format:\'\',height:0,width:0});\n }\n })\n });\n\n };\n\n\n}; if (typeof Plotly === \"undefined\"){\n var script = document.createElement(\"script\");\n...
View in text
Excerpt 4
dim=2 We can also add the elements of one array to another. &data_2D + &data_2D [[2.0, 4.0, 6.0], [8.0, 10.0, 12.0]], shape=[2, 3], strides=[3, 1], layout=C...
View in text
Excerpt 5
.3" "2.5" "5.0" "1.9" "Iris-virginica" "148" "6.5" "3.0" "5.2" "2.0" "Iris-virginica" "149" "6.2" "3.4" "5.4" "2.3" "Iris-virginica" "150" "5.9" "3.0" "5.1"...
View in text
Excerpt 6
t(plot); Page 54 licensed to yz@mtx.gg on 18th January 2022 Typed Arrays from String Arrays for Dataset Operation :dep itertools = {version = "0.9.0"} extern...
View in text
Excerpt 7
We would access the third element using example[2] Page 68 licensed to yz@mtx.gg on 18th January 2022 NDArray Index Arrays and Mask Index Arrays We'll also c...
View in text
Excerpt 8
ro features of the chord crate, get Chord Pro. The Dataset The focus for this section will be the demonstration of the chord crate. To keep it simple, we wil...
View in text
Tags
AI categories
ProgrammingDataTechnology
Language: English
File Format: PDF
File Size: 5.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…