From 6ed675680da076266c28aff45a047eacab189636 Mon Sep 17 00:00:00 2001 From: rafaelmello82 <64922281+rafaelmello82@users.noreply.github.com> Date: Sun, 2 Aug 2020 09:07:04 +0100 Subject: [PATCH] lab_ finished_Rafael_mello --- {data => your-code}/ages_population.csv | 0 {data => your-code}/ages_population2.csv | 0 {data => your-code}/ages_population3.csv | 0 your-code/main.ipynb | 1654 ++++++++++++++++- {data => your-code}/roll_the_dice_hundred.csv | 0 .../roll_the_dice_thousand.csv | 0 6 files changed, 1567 insertions(+), 87 deletions(-) rename {data => your-code}/ages_population.csv (100%) rename {data => your-code}/ages_population2.csv (100%) rename {data => your-code}/ages_population3.csv (100%) rename {data => your-code}/roll_the_dice_hundred.csv (100%) rename {data => your-code}/roll_the_dice_thousand.csv (100%) diff --git a/data/ages_population.csv b/your-code/ages_population.csv similarity index 100% rename from data/ages_population.csv rename to your-code/ages_population.csv diff --git a/data/ages_population2.csv b/your-code/ages_population2.csv similarity index 100% rename from data/ages_population2.csv rename to your-code/ages_population2.csv diff --git a/data/ages_population3.csv b/your-code/ages_population3.csv similarity index 100% rename from data/ages_population3.csv rename to your-code/ages_population3.csv diff --git a/your-code/main.ipynb b/your-code/main.ipynb index a0a5b66..2d05c94 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -11,11 +11,15 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ - "# Libraries" + "# Libraries\n", + "import pandas as pd \n", + "import random\n", + "import matplotlib.pyplot as plt \n", + "import numpy as np" ] }, { @@ -29,11 +33,120 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ - "# your code here" + "# your code here\n", + "\n", + "result_list=[] \n", + "\n", + "def dice (x):\n", + " for i in range(x):\n", + " result = random.randint(1, 6)\n", + " result_list.append(result)\n", + "\n", + "result_list \n", + "\n", + "dice(10)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | 0 | \n", + "
|---|---|
| 0 | \n", + "3 | \n", + "
| 1 | \n", + "3 | \n", + "
| 2 | \n", + "5 | \n", + "
| 3 | \n", + "1 | \n", + "
| 4 | \n", + "4 | \n", + "
| 5 | \n", + "5 | \n", + "
| 6 | \n", + "4 | \n", + "
| 7 | \n", + "6 | \n", + "
| 8 | \n", + "2 | \n", + "
| 9 | \n", + "3 | \n", + "
| \n", + " | 0 | \n", + "
|---|---|
| 0 | \n", + "3 | \n", + "
| 1 | \n", + "3 | \n", + "
| 2 | \n", + "5 | \n", + "
| 3 | \n", + "1 | \n", + "
| 4 | \n", + "4 | \n", + "
| 5 | \n", + "5 | \n", + "
| 6 | \n", + "4 | \n", + "
| 7 | \n", + "6 | \n", + "
| 8 | \n", + "2 | \n", + "
| 9 | \n", + "3 | \n", + "
| \n", + " | Unnamed: 0 | \n", + "roll | \n", + "value | \n", + "
|---|---|---|---|
| 0 | \n", + "0 | \n", + "0 | \n", + "1 | \n", + "
| 47 | \n", + "47 | \n", + "47 | \n", + "1 | \n", + "
| 56 | \n", + "56 | \n", + "56 | \n", + "1 | \n", + "
| 9 | \n", + "9 | \n", + "9 | \n", + "1 | \n", + "
| 73 | \n", + "73 | \n", + "73 | \n", + "1 | \n", + "
| ... | \n", + "... | \n", + "... | \n", + "... | \n", + "
| 17 | \n", + "17 | \n", + "17 | \n", + "6 | \n", + "
| 11 | \n", + "11 | \n", + "11 | \n", + "6 | \n", + "
| 24 | \n", + "24 | \n", + "24 | \n", + "6 | \n", + "
| 21 | \n", + "21 | \n", + "21 | \n", + "6 | \n", + "
| 99 | \n", + "99 | \n", + "99 | \n", + "6 | \n", + "
100 rows × 3 columns
\n", + "| \n", + " | observation | \n", + "
|---|---|
| 0 | \n", + "68.0 | \n", + "
| 1 | \n", + "12.0 | \n", + "
| 2 | \n", + "45.0 | \n", + "
| 3 | \n", + "38.0 | \n", + "
| 4 | \n", + "49.0 | \n", + "
| ... | \n", + "... | \n", + "
| 995 | \n", + "27.0 | \n", + "
| 996 | \n", + "47.0 | \n", + "
| 997 | \n", + "53.0 | \n", + "
| 998 | \n", + "33.0 | \n", + "
| 999 | \n", + "31.0 | \n", + "
1000 rows × 1 columns
\n", + "| \n", + " | observation | \n", + "
|---|---|
| 0 | \n", + "68.0 | \n", + "
| 1 | \n", + "12.0 | \n", + "
| 2 | \n", + "45.0 | \n", + "
| 3 | \n", + "38.0 | \n", + "
| 4 | \n", + "49.0 | \n", + "
| ... | \n", + "... | \n", + "
| 995 | \n", + "27.0 | \n", + "
| 996 | \n", + "47.0 | \n", + "
| 997 | \n", + "53.0 | \n", + "
| 998 | \n", + "33.0 | \n", + "
| 999 | \n", + "31.0 | \n", + "
1000 rows × 1 columns
\n", + "| \n", + " | observation | \n", + "
|---|---|
| 0 | \n", + "21.0 | \n", + "
| 1 | \n", + "21.0 | \n", + "
| 2 | \n", + "24.0 | \n", + "
| 3 | \n", + "31.0 | \n", + "
| 4 | \n", + "54.0 | \n", + "
| ... | \n", + "... | \n", + "
| 995 | \n", + "16.0 | \n", + "
| 996 | \n", + "55.0 | \n", + "
| 997 | \n", + "30.0 | \n", + "
| 998 | \n", + "35.0 | \n", + "
| 999 | \n", + "43.0 | \n", + "
1000 rows × 1 columns
\n", + "