You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/tutorial-ma.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ rows of this file, since they contain other data we are not interested in. Separ
92
92
# Read just the dates for columns 4-18 from the first row
93
93
dates = np.genfromtxt(
94
94
filename,
95
-
dtype=np.unicode_,
95
+
dtype=np.str_,
96
96
delimiter=",",
97
97
max_rows=1,
98
98
usecols=range(4, 18),
@@ -102,7 +102,7 @@ dates = np.genfromtxt(
102
102
# columns, skipping the first six rows
103
103
locations = np.genfromtxt(
104
104
filename,
105
-
dtype=np.unicode_,
105
+
dtype=np.str_,
106
106
delimiter=",",
107
107
skip_header=6,
108
108
usecols=(0, 1),
@@ -119,7 +119,7 @@ nbcases = np.genfromtxt(
119
119
)
120
120
```
121
121
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).
0 commit comments