Skip to content

Commit 03a1e28

Browse files
committed
221228c
1 parent 607f1f9 commit 03a1e28

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

07_gestion_y_analisis_de_datos_de_numpy.ipynb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,60 @@
10611061
"np.all(booleano[2])"
10621062
]
10631063
},
1064+
{
1065+
"cell_type": "markdown",
1066+
"metadata": {},
1067+
"source": [
1068+
"## Funciones de búsqueda y orden."
1069+
]
1070+
},
1071+
{
1072+
"cell_type": "markdown",
1073+
"metadata": {},
1074+
"source": [
1075+
"### La función ```np.where()```.\n",
1076+
"\n",
1077+
"https://numpy.org/doc/stable/reference/generated/numpy.where.html"
1078+
]
1079+
},
1080+
{
1081+
"cell_type": "code",
1082+
"execution_count": null,
1083+
"metadata": {},
1084+
"outputs": [],
1085+
"source": [
1086+
"numeros = np.array([[1.43, -1, 45.9999, -3.41],\n",
1087+
" [np.inf, -np.inf, np.inf, np.inf],\n",
1088+
" [np.nan, 13.45, 11, 21]])"
1089+
]
1090+
},
1091+
{
1092+
"cell_type": "code",
1093+
"execution_count": null,
1094+
"metadata": {},
1095+
"outputs": [],
1096+
"source": [
1097+
"np.where(numeros == np.inf)"
1098+
]
1099+
},
1100+
{
1101+
"cell_type": "code",
1102+
"execution_count": null,
1103+
"metadata": {},
1104+
"outputs": [],
1105+
"source": [
1106+
"numeros[np.where(numeros == np.inf)]"
1107+
]
1108+
},
1109+
{
1110+
"cell_type": "code",
1111+
"execution_count": null,
1112+
"metadata": {},
1113+
"outputs": [],
1114+
"source": [
1115+
"np.where(numeros == np.inf, 1, numeros + 1)"
1116+
]
1117+
},
10641118
{
10651119
"cell_type": "markdown",
10661120
"metadata": {},

0 commit comments

Comments
 (0)