Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 101 additions & 24 deletions notebooks/03_programacion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Moratalaz': 95000, 'Centro': 150000, 'Barajas': 46000}"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"poblacion = {'Moratalaz': 95000,\n",
" 'Centro': 150000,\n",
Expand Down Expand Up @@ -746,9 +757,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Moratalaz': 95.0, 'Centro': 150.0, 'Barajas': 46.0}"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Atención al .items() para poder iterar sobre clave y valor en el dict\n",
"\n",
Expand Down Expand Up @@ -801,9 +823,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"datetime.date(2019, 1, 30)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from datetime import date, datetime\n",
"\n",
Expand All @@ -813,9 +846,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"datetime.datetime(2019, 3, 30, 14, 35, 59)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fecha_hora = datetime(2019, 3, 30, 14, 35, 59)\n",
"fecha_hora"
Expand All @@ -830,9 +874,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"datetime.date(2019, 3, 30)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fecha_hora.date()"
]
Expand All @@ -849,18 +904,40 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2019-01-30'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fecha.strftime('%Y-%m-%d')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'2019-03-30 14:35:59'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fecha_hora.strftime('%Y-%m-%d %H:%M:%S')"
]
Expand Down Expand Up @@ -1154,9 +1231,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "libropython",
"display_name": "Python 3",
"language": "python",
"name": "libropython"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1168,7 +1245,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
Loading