We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5da34f commit c8388f9Copy full SHA for c8388f9
examples/pylab_examples/mri_with_eeg.py
@@ -20,6 +20,7 @@
20
dfile = cbook.get_sample_data('s1045.ima.gz')
21
im = np.fromstring(dfile.read(), np.uint16).astype(float)
22
im.shape = (256, 256)
23
+dfile.close()
24
25
# Plot the MRI image
26
ax0 = fig.add_subplot(2, 2, 1)
@@ -41,7 +42,7 @@
41
42
numSamples, numRows = 800, 4
43
eegfile = cbook.get_sample_data('eeg.dat', asfileobj=False)
44
print('Loading EEG %s' % eegfile)
-data = np.fromstring(open(eegfile, 'rb').read(), float)
45
+data = np.fromfile(eegfile, dtype=float)
46
data.shape = (numSamples, numRows)
47
t = 10.0 * np.arange(numSamples) / numSamples
48
0 commit comments