Skip to content

Commit

Permalink
Exlain the notebook download links
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Aug 7, 2024
1 parent 33cd26e commit f6d18fd
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 16 deletions.
5 changes: 3 additions & 2 deletions notes/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ See <https://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html>
* `np.all` (done in `probabality_theory_4_finite`).
* Need `plt.hist`, at least by `probabality_theory_4_finite`. We should
probably have a section or even a chapter on histograms.
* Need slicing with slices, sometime before use in `more_sampling_tools`. Also
used in `standard_scores`.
* Need slicing with slices, sometime before use in
`more_sampling_tools`. Also used in
`standard_scores` around line 319.
* Introduce the idea of objects and classes. First obviously needed in
`standard_scores.Rmd` page, see line that currently reads:

Expand Down
7 changes: 7 additions & 0 deletions source/correlation_causation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,13 @@ Finally, we count (`sum`) the trials in which the sum of the products of the
randomly-paired athletic and I.Q. scores equals or exceeds the sum of the
products in the observed data.

:::{.callout-note}
## Notebook with data file

As have seen already (see @sec-download-links),the download link points to
a `.zip` file containing the notebook and the data file the notebook will read.
:::

::: {.notebook name="athlete_iq" title="Association of athletic and IQ scores"}

::: nb-only
Expand Down
46 changes: 32 additions & 14 deletions source/standard_scores.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,29 @@ print(f"""{backticks}
In the code that follows, we will *read* the values from the CSV file directly into {{< var lang >}}.

:::{.callout-note}
## Download links with data files
## Download links with data files {#sec-download-links}

Up till now, the Download links for notebook files give you a link to a single file — the *notebook*. The
Up till now, the Download links for notebook files point to a single file — the *notebook*. The
[Jupyter notebook file has extension `.ipynb`]{.python}
[RStudio notebook file has extension `.Rmd`]{.r}

[RStudio notebook file has extension `.Rmd`]{.r}.

From now on, some examples involve reading a data file. In order to run the
notebook, you need the notebook file
(with extension[`.ipynb`]{.python}[`.Rmd`]{.r})
as well as the data file. For those cases, the download link points to
a `.zip` file containing the notebook file and the data file. To run the
example on your computer, download the `.zip` file, extract the contents, and
then open the notebook file using {{< var nb_app >}}.
:::



::: {.notebook name="four_girls_one_boy" title="Four girls and one boy"}


::: python

### Introducing the Pandas library {#sec-pandas-intro}

Here we start using the Pandas library to load table data into Python.
::: {.notebook name="starting_pandas" title="Starting with Pandas"}

Here we use the Pandas library to load table data into Python.

Thus far we have used the Numpy library to work with data in arrays. As always
with Python, when we want to use a library — like Numpy, or Pandas — we have to
Expand Down Expand Up @@ -261,11 +266,6 @@ If the data were not already in income order, we could have sorted them with

:::


:::



We are particularly interested in the column named `Median_Income`.

You may remember the idea of *indexing*, introduced in @sec-array-indexing.
Expand Down Expand Up @@ -312,11 +312,21 @@ incomes[:5]
```

:::
<!---
End of notebook.
-->

:::
<!---
End of python block
-->

::: r

### Introducing R data frames

::: {.notebook name="intro_data_frames" title="Introducing data frames"}

R is a data analysis language, so, as you would expect, it is particularly good
at loading data files, and presenting them to us as a useful table-like
structure, called a *data frame*.
Expand Down Expand Up @@ -367,6 +377,14 @@ incomes[1:5]
```

:::
<!---
End of notebook.
-->

:::
<!---
End of R block
-->

### Incomes and Ranks

Expand Down
8 changes: 8 additions & 0 deletions source/testing_measured.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ many times resample A exceeded resample B by at least 38 pounds, or vice versa
(we are testing whether the two are different, not whether food A produces
larger weight gains).

:::{.callout-note}
## Notebook with data file

As you saw in @sec-download-links, the following notebook reads a data file, so
the download link points to a `.zip` file containing the notebook and the data
file.
:::

::: {.notebook name="measured_rations" title="Pig rations via bootstrap"}

::: nb-only
Expand Down

0 comments on commit f6d18fd

Please sign in to comment.