--- title: "STAT 540 hw (which homework)" author: "(your name)" format: html jupyter: python3 execute: echo: true --- ## Quarto Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see . ## Before you start This course assumes you have installed **Anaconda**, which comes with Python, Jupyter, NumPy, pandas and matplotlib --- everything this template needs. If a render fails complaining that Jupyter or a kernel cannot be found, open the **Anaconda Prompt** (Windows) or a terminal (Mac) and run: ``` quarto check jupyter ``` Render from that same prompt/terminal, or launch your editor from it, so that Quarto finds the Anaconda Python rather than some other one on your machine. ## Submitting your homework Compile your homework as a webpage (html). Then open it in a browser and print it to a .pdf file. Upload this pdf file to blackboard. ## Running code When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this: ```{python} 1 + 1 ``` You can add options to executable code like this ```{python} #| echo: false 2 * 2 ``` The `echo: false` option disables the printing of code (only output is displayed). ## Loading libraries Unlike R, Python needs libraries imported before you can use them. Put your imports in one chunk near the top: ```{python} import numpy as np ``` ## Showing more than one result Only the **last** expression in a chunk is displayed automatically. Use `print()` if you want to see several results from the same chunk: ```{python} x = np.array([1, 2, 3]) print(x.mean()) print(x.sum()) ```