Skip to content

Commit f375a5c

Browse files
committed
MAINT: content fixes for numpy 2.0
1 parent 07e9da0 commit f375a5c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/tutorial-ma.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ rows of this file, since they contain other data we are not interested in. Separ
9292
# Read just the dates for columns 4-18 from the first row
9393
dates = np.genfromtxt(
9494
filename,
95-
dtype=np.unicode_,
95+
dtype=np.str_,
9696
delimiter=",",
9797
max_rows=1,
9898
usecols=range(4, 18),
@@ -102,7 +102,7 @@ dates = np.genfromtxt(
102102
# columns, skipping the first six rows
103103
locations = np.genfromtxt(
104104
filename,
105-
dtype=np.unicode_,
105+
dtype=np.str_,
106106
delimiter=",",
107107
skip_header=6,
108108
usecols=(0, 1),
@@ -119,7 +119,7 @@ nbcases = np.genfromtxt(
119119
)
120120
```
121121

122-
Included in the `numpy.genfromtxt` function call, we have selected the [numpy.dtype](https://numpy.org/devdocs/reference/generated/numpy.dtype.html#numpy.dtype) for each subset of the data (either an integer - `numpy.int_` - or a string of characters - `numpy.unicode_`). We have also used the `encoding` argument to select `utf-8-sig` as the encoding for the file (read more about encoding in the [official Python documentation](https://docs.python.org/3/library/codecs.html#encodings-and-unicode). You can read more about the `numpy.genfromtxt` function from the [Reference Documentation](https://numpy.org/devdocs/reference/generated/numpy.genfromtxt.html#numpy.genfromtxt) or from the [Basic IO tutorial](https://numpy.org/devdocs/user/basics.io.genfromtxt.html).
122+
Included in the `numpy.genfromtxt` function call, we have selected the [numpy.dtype](https://numpy.org/devdocs/reference/generated/numpy.dtype.html#numpy.dtype) for each subset of the data (either an integer - `numpy.int_` - or a string of characters - `numpy.str_`). We have also used the `encoding` argument to select `utf-8-sig` as the encoding for the file (read more about encoding in the [official Python documentation](https://docs.python.org/3/library/codecs.html#encodings-and-unicode). You can read more about the `numpy.genfromtxt` function from the [Reference Documentation](https://numpy.org/devdocs/reference/generated/numpy.genfromtxt.html#numpy.genfromtxt) or from the [Basic IO tutorial](https://numpy.org/devdocs/user/basics.io.genfromtxt.html).
123123

124124
+++
125125

0 commit comments

Comments
 (0)