Skip to content

Commit df7aa1c

Browse files
authored
Merge pull request joanby#18 from johnnync13/master
Adaptado todos los notebooks, menos T10, hay que rehacer las graficas
2 parents ac65435 + 6cb1af4 commit df7aa1c

6 files changed

Lines changed: 79 additions & 25 deletions

notebooks/T10 - 2 - Analisis de Componentes Principales SK Learn-Colab.ipynb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@
6666
"metadata": {},
6767
"outputs": [],
6868
"source": [
69+
"!pip install chart_studio\n",
6970
"import pandas as pd\n",
7071
"\n",
71-
"import plotly.plotly as py\n",
72+
"import chart_studio.plotly as py\n",
7273
"from plotly.graph_objs import * \n",
73-
"import plotly.tools as tls\n",
74+
"from chart_studio import tools as tls\n",
7475
"\n",
7576
"from sklearn.preprocessing import StandardScaler\n",
7677
"\n",
@@ -83,7 +84,7 @@
8384
"metadata": {},
8485
"outputs": [],
8586
"source": [
86-
"df = pd.read_csv(\"../datasets/iris/iris.csv\")"
87+
"df = pd.read_csv(\"/content/python-ml-course/datasets/iris/iris.csv\")"
8788
]
8889
},
8990
{

notebooks/T10 - 3 - Plotly para dibujar-Colab.ipynb

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,52 @@
77
"<a href=\"https://colab.research.google.com/github/joanby/python-ml-course/blob/master/notebooks/T10%20-%203%20-%20Plotly%20para%20dibujar-Colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
88
]
99
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"# Clonamos el repositorio para obtener los dataSet"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": null,
20+
"metadata": {},
21+
"outputs": [],
22+
"source": [
23+
"!git clone https://github.com/joanby/python-ml-course.git"
24+
]
25+
},
26+
{
27+
"cell_type": "markdown",
28+
"metadata": {},
29+
"source": [
30+
"# Damos acceso a nuestro Drive"
31+
]
32+
},
33+
{
34+
"cell_type": "code",
35+
"execution_count": null,
36+
"metadata": {},
37+
"outputs": [],
38+
"source": [
39+
"from google.colab import drive\n",
40+
"drive.mount('/content/drive')\n",
41+
"# Test it\n",
42+
"!ls '/content/drive/My Drive' "
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"metadata": {},
49+
"outputs": [],
50+
"source": [
51+
"from google.colab import files # Para manejar los archivos y, por ejemplo, exportar a su navegador\n",
52+
"import glob # Para manejar los archivos y, por ejemplo, exportar a su navegador\n",
53+
"from google.colab import drive # Montar tu Google drive"
54+
]
55+
},
1056
{
1157
"cell_type": "markdown",
1258
"metadata": {},
@@ -32,9 +78,10 @@
3278
}
3379
],
3480
"source": [
35-
"import plotly.plotly as py\n",
36-
"import plotly.graph_objs as go \n",
37-
"import plotly.tools as tls\n",
81+
"!pip install chart_studio\n",
82+
"import chart_studio.plotly as py\n",
83+
"import plotly.graph_objects as go\n",
84+
"from chart_studio import tools as tls\n",
3885
"\n",
3986
"tls.set_credentials_file(username='JuanGabriel', api_key='6mEfSXf8XNyIzpxwb8z7')"
4087
]
@@ -61,13 +108,6 @@
61108
"plotly.__version__"
62109
]
63110
},
64-
{
65-
"cell_type": "code",
66-
"execution_count": null,
67-
"metadata": {},
68-
"outputs": [],
69-
"source": []
70-
},
71111
{
72112
"cell_type": "code",
73113
"execution_count": 5,
@@ -3895,7 +3935,7 @@
38953935
"outputs": [],
38963936
"source": [
38973937
"import pandas as pd\n",
3898-
"data = pd.read_csv(\"../datasets/usa-population/usa_states_population.csv\")"
3938+
"data = pd.read_csv(\"/content/python-ml-course/datasets/usa-population/usa_states_population.csv\")"
38993939
]
39003940
},
39013941
{

notebooks/T11 - 1 - TensorFlow101-Colab.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
78-
"import tensorflow\n",
78+
"import tensorflow as tf\n",
7979
"print(tensorflow.__version__)"
8080
]
8181
},

notebooks/T11 - 2 - Señales de tráfico-Colab.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
78-
"import tensorflow\n",
79-
"print(tensorflow.__version__)\n",
78+
"import tensorflow as tf\n",
79+
"print(tf.__version__)\n",
8080
"import os\n",
81-
"import skimage.data as imd\n",
81+
"import skimage.io as imd\n",
8282
"import numpy as np"
8383
]
8484
},
@@ -113,7 +113,7 @@
113113
"metadata": {},
114114
"outputs": [],
115115
"source": [
116-
"main_dir = \"../datasets/belgian/\"\n",
116+
"main_dir = \"/content/python-ml-course/datasets/belgian/\"\n",
117117
"train_data_dir = os.path.join(main_dir, \"Training\")\n",
118118
"test_data_dir = os.path.join(main_dir, \"Testing\")"
119119
]

notebooks/T11 - 3 - Reconocimiento de texto escrito-Colab.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"metadata": {},
7676
"outputs": [],
7777
"source": [
78-
"import tensorflow\n",
79-
"print(tensorflow.__version__)\n",
78+
"import tensorflow as tf\n",
79+
"print(tf.__version__)\n",
8080
"from tensorflow.examples.tutorials.mnist import input_data"
8181
]
8282
},

notebooks/T12 - 1 - R y Python-Colab.ipynb

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": null,
19+
"execution_count": 1,
2020
"metadata": {},
21-
"outputs": [],
21+
"outputs": [
22+
{
23+
"name": "stdout",
24+
"output_type": "stream",
25+
"text": [
26+
"Cloning into 'python-ml-course'...\n",
27+
"remote: Enumerating objects: 90, done.\u001b[K\n",
28+
"remote: Counting objects: 100% (90/90), done.\u001b[K\n",
29+
"remote: Compressing objects: 100% (64/64), done.\u001b[K\n",
30+
"^Cceiving objects: 11% (1937/17605), 56.04 MiB | 22.20 MiB/s\n"
31+
]
32+
}
33+
],
2234
"source": [
2335
"!git clone https://github.com/joanby/python-ml-course.git"
2436
]
@@ -86,6 +98,7 @@
8698
"metadata": {},
8799
"outputs": [],
88100
"source": [
101+
"!pip install rpy2\n",
89102
"import rpy2.robjects as ro\n",
90103
"import rpy2.robjects.numpy2ri"
91104
]
@@ -881,7 +894,7 @@
881894
}
882895
],
883896
"source": [
884-
"data = pd.read_csv(\"../datasets/time/time_series.txt\", \n",
897+
"data = pd.read_csv(\"/content/python-ml-course/datasets/time/time_series.txt\", \n",
885898
" sep = \"\\s*\", skiprows = 1, parse_dates = [[0,1]],\n",
886899
" names = [\"date\", \"time\", \"wind_speed\"],\n",
887900
" index_col = 0)"
@@ -999,7 +1012,7 @@
9991012
}
10001013
],
10011014
"source": [
1002-
"max_ws = data.wind_speed.groupby(pd.TimeGrouper(freq=\"A\")).max()"
1015+
"max_ws = data.wind_speed.groupby(pd.Grouper(freq=\"A\")).max()"
10031016
]
10041017
},
10051018
{

0 commit comments

Comments
 (0)