Compare commits

...

3 Commits

Author SHA1 Message Date
rougier
a3beca2d7f solutions update from 7dcb112 2026-07-24 13:36:00 +00:00
Nicolas P. Rougier
7dcb112f80 Merge pull request #258 from AmitSubhash/fix/q51-structured-dtype-deprecation
Fix exercise 51: deprecated (type, 1) structured dtype -> scalar fields
2026-07-24 15:35:37 +02:00
AmitSubhash
6c091f3a12 Fix exercise 51: deprecated (type, 1) structured dtype -> scalar fields (source ktx only; maintainer regenerates outputs) 2026-07-22 09:34:09 +05:30
5 changed files with 224 additions and 224 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -494,11 +494,11 @@ print(Z[index])
`hint: dtype`
```python
Z = np.zeros(10, [ ('position', [ ('x', float, 1),
('y', float, 1)]),
('color', [ ('r', float, 1),
('g', float, 1),
('b', float, 1)])])
Z = np.zeros(10, [ ('position', [ ('x', float),
('y', float)]),
('color', [ ('r', float),
('g', float),
('b', float)])])
print(Z)
```
#### 52. Consider a random vector with shape (100,2) representing coordinates, find point by point distances (★★☆)

View File

@@ -494,11 +494,11 @@ print(Z[index])
```python
Z = np.zeros(10, [ ('position', [ ('x', float, 1),
('y', float, 1)]),
('color', [ ('r', float, 1),
('g', float, 1),
('b', float, 1)])])
Z = np.zeros(10, [ ('position', [ ('x', float),
('y', float)]),
('color', [ ('r', float),
('g', float),
('b', float)])])
print(Z)
```
#### 52. Consider a random vector with shape (100,2) representing coordinates, find point by point distances (★★☆)

View File

@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "4a87d009",
"id": "261c7cb9",
"metadata": {},
"source": [
"# 100 numpy exercises\n",
@@ -18,7 +18,7 @@
},
{
"cell_type": "markdown",
"id": "16b631f6",
"id": "b0ffec6a",
"metadata": {},
"source": [
"File automatically generated. See the documentation to update questions/answers/hints programmatically."
@@ -26,7 +26,7 @@
},
{
"cell_type": "markdown",
"id": "8c00c264",
"id": "30434163",
"metadata": {},
"source": [
"Run the `initialise.py` module, then call a random question with `pick()` an hint towards its solution with\n",
@@ -36,7 +36,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c5fa0b45",
"id": "8f632d6c",
"metadata": {},
"outputs": [],
"source": [
@@ -46,7 +46,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6c4f9753",
"id": "6cfc4341",
"metadata": {},
"outputs": [],
"source": [

View File

@@ -633,11 +633,11 @@ Create a structured array representing a position (x,y) and a color (r,g,b) (★
hint: dtype
< a51
Z = np.zeros(10, [ ('position', [ ('x', float, 1),
('y', float, 1)]),
('color', [ ('r', float, 1),
('g', float, 1),
('b', float, 1)])])
Z = np.zeros(10, [ ('position', [ ('x', float),
('y', float)]),
('color', [ ('r', float),
('g', float),
('b', float)])])
print(Z)
< q52