## Example 1: `Hello world`


```python
# Print the character string `Hello world!`

```

## Example 2: Make a plot of the US unemployment rate

Download unemployment rate data from FRED (https://fred.stlouisfed.org/series/UNRATE/) and make a well-labeled plot.


```python
# Import the pandas library as pd


# Import the plotting library matplotlib.pyplot as plt


# Download the unemployment rate data (PROVIDED)
unemployment = pd.read_csv('https://fred.stlouisfed.org/data/UNRATE.txt',skiprows=24,sep='\s+',index_col=0,parse_dates = True)

# Print first 5 rows of unemployment variable

```


```python
# Create a well-labeled plot of the US unemployment rate


# Save the figure to the current working directory at 120 dots per inch resolution

```

## Example 2: Date and time

Use the `datetime` module to print the current date and time


```python
# Import the datetime module


# Create a variable called `today` that stores the current date and time


# Print the value of `today`

```


```python
# Print today's date formatted as: month day, year

```


```python
# Print the time component of `today` as: HH:MM:SS

```

## Example 3: Approximate a geometric series


Consider the infinite geometric series:

\begin{align}
\sum_{k=0}^{\infty} r^k & = r + r + r^2 + r^3 + \cdots
\end{align}

If $|r|<1$, then the series converges to:

\begin{align}
\frac{1}{1+r}
\end{align}

We can verify this fact numerically by computing the *truncated* series, i.e., compute the series to a finite number of terms. We will do this for $r=0.2$. The idea is to create a variable $s$ that is initially equal to zero. Then we let $k$ increment from 0, 1, up to $N$ and each time add $r^k$ to $s$.


```python
# Set the value of r


# Create a variable `N` that stores the desired number of terms to compute


# Initialize a variable that will store the value of the summation. Set equal to tzero


# Iterate over values of k fron 0 to N. Add the new term to the sum and print the current value of the sum



```

## Example 4: Draw random values from a normal probability distribution

The `numpy` library has a bunch of powerful tools for working with numbers. Here we'll use `numpy` to draw a random sample from the normal probability distribution. Specifically, 100 values from $\mathcal{N}(2,0.2^2)$.


```python
# Import the numpy numerical tools library as np 


# Set the seed or state of the numpy random number generator


# Create a variable called 'x' that contains 100 draws from the normal(2,0.2^2) didistribution



```


```python
# Print the mean of the values in the variable 'x'

```


```python
# Print the standard deviation of the values in the variable 'x'

```

44c883245937d3190b6d091684ca3ae60122e781
ipynb
Jupyter Notebook
Lecture Notebooks/Econ126_Class_01_blank.ipynb
letsgoexploring/econ126
05f50d2392dd1c7c38b14950cb8d7eff7ff775ee
MIT
2020-12-12T16:28:44.000Z
2021-02-24T12:11:04.000Z
Lecture Notebooks/Econ126_Class_01_blank.ipynb
letsgoexploring/econ126
05f50d2392dd1c7c38b14950cb8d7eff7ff775ee
MIT
2019-04-29T08:50:41.000Z
2019-04-29T08:51:05.000Z
Lecture Notebooks/Econ126_Class_01_blank.ipynb
letsgoexploring/econ126
05f50d2392dd1c7c38b14950cb8d7eff7ff775ee
MIT
2019-03-08T18:49:19.000Z
2022-03-07T23:27:16.000Z
Qwen/Qwen-72B
1. YES
2. YES