Skip to content

Latest commit

 

History

History
85 lines (71 loc) · 1.31 KB

unit1.md

File metadata and controls

85 lines (71 loc) · 1.31 KB
title jupytext kernelspec math
Unit 1: Intro
formats text_representation
md:myst
extension format_name
.md
myst
display_name language name
Python 3
python
python3
\trans \eps
^\mathsf{T}
\epsilon

:::{tip} Code cells on this Markdown page are not executed when the page is built. :::

This is the mean of some random numbers using numpy.

import numpy as np
mean = np.mean(np.random.normal(size=100))
print(f"{mean=}")

$$ \theta = \int_0^\infty f(x,\theta)d\theta $$

Use a $\LaTeX$ macro.

$$ A = X \trans Y $$

:::{tip} Tip with Title This is an example of a callout with a title. :::

Here's a tabset

::::{tab-set} :::{tab-item} R :sync: tab1

:name: R example
:caption: fizz_buzz definition in R
fizz_buzz <- function(fbnums = 1:50) {
  output <- dplyr::case_when(
    fbnums %% 15 == 0 ~ "FizzBuzz",
    fbnums %% 3 == 0 ~ "Fizz",
    fbnums %% 5 == 0 ~ "Buzz",
    TRUE ~ as.character(fbnums)
  )
  print(output)
}

fizz_buzz(3)

::: :::{tab-item} Python :sync: tab2

:name: Python example
:caption: fizz_buzz definition in Python

def fizz_buzz(num):
  if num % 15 == 0:
    print("FizzBuzz")
  elif num % 5 == 0:
    print("Buzz")
  elif num % 3 == 0:
    print("Fizz")
  else:
    print(num)

fizz_buzz(3)

::: ::::