📚 The CoCalc Library - books, templates and other resources
License: OTHER
Kernel: Python 3
In [1]:
In [2]:
In [3]:
In [4]:
Out[4]:
In [5]:
Out[5]:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
343 method = get_real_method(obj, self.print_method)
344 if method is not None:
--> 345 return method()
346 return None
347 else:
~/anaconda3/lib/python3.6/site-packages/matplotlib/animation.py in _repr_html_(self)
1482 fmt = rcParams['animation.html']
1483 if fmt == 'html5':
-> 1484 return self.to_html5_video()
1485 elif fmt == 'jshtml':
1486 return self.to_jshtml()
~/anaconda3/lib/python3.6/site-packages/matplotlib/animation.py in to_html5_video(self, embed_limit)
1411 bitrate=rcParams['animation.bitrate'],
1412 fps=1000. / self._interval)
-> 1413 self.save(f.name, writer=writer)
1414
1415 # Now open and base64 encode
~/anaconda3/lib/python3.6/site-packages/matplotlib/animation.py in save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs)
1258 # TODO: See if turning off blit is really necessary
1259 anim._draw_next_frame(d, blit=False)
-> 1260 writer.grab_frame(**savefig_kwargs)
1261
1262 # Reconnect signal for first draw if necessary
~/anaconda3/lib/python3.6/contextlib.py in __exit__(self, type, value, traceback)
97 value = type()
98 try:
---> 99 self.gen.throw(type, value, traceback)
100 except StopIteration as exc:
101 # Suppress StopIteration *unless* it's the same exception that
~/anaconda3/lib/python3.6/site-packages/matplotlib/animation.py in saving(self, fig, outfile, dpi, *args, **kwargs)
235 yield self
236 finally:
--> 237 self.finish()
238
239
~/anaconda3/lib/python3.6/site-packages/matplotlib/animation.py in finish(self)
367 def finish(self):
368 '''Finish any processing for writing the movie.'''
--> 369 self.cleanup()
370
371 def grab_frame(self, **savefig_kwargs):
~/anaconda3/lib/python3.6/site-packages/matplotlib/animation.py in cleanup(self)
406 def cleanup(self):
407 '''Clean-up and collect the process used to write the movie file.'''
--> 408 out, err = self._proc.communicate()
409 self._frame_sink().close()
410 verbose.report('MovieWriter -- '
~/anaconda3/lib/python3.6/subprocess.py in communicate(self, input, timeout)
841
842 try:
--> 843 stdout, stderr = self._communicate(input, endtime, timeout)
844 finally:
845 self._communication_started = True
~/anaconda3/lib/python3.6/subprocess.py in _communicate(self, input, endtime, orig_timeout)
1503 selector.register(self.stdin, selectors.EVENT_WRITE)
1504 if self.stdout:
-> 1505 selector.register(self.stdout, selectors.EVENT_READ)
1506 if self.stderr:
1507 selector.register(self.stderr, selectors.EVENT_READ)
~/anaconda3/lib/python3.6/selectors.py in register(self, fileobj, events, data)
349
350 def register(self, fileobj, events, data=None):
--> 351 key = super().register(fileobj, events, data)
352 poll_events = 0
353 if events & EVENT_READ:
~/anaconda3/lib/python3.6/selectors.py in register(self, fileobj, events, data)
235 raise ValueError("Invalid events: {!r}".format(events))
236
--> 237 key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data)
238
239 if key.fd in self._fd_to_key:
~/anaconda3/lib/python3.6/selectors.py in _fileobj_lookup(self, fileobj)
222 """
223 try:
--> 224 return _fileobj_to_fd(fileobj)
225 except ValueError:
226 # Do an exhaustive search.
~/anaconda3/lib/python3.6/selectors.py in _fileobj_to_fd(fileobj)
37 except (AttributeError, TypeError, ValueError):
38 raise ValueError("Invalid file object: "
---> 39 "{!r}".format(fileobj)) from None
40 if fd < 0:
41 raise ValueError("Invalid file descriptor: {}".format(fd))
ValueError: Invalid file object: <_io.BufferedReader name=49>
<matplotlib.animation.FuncAnimation at 0x7f4f0f772390>
In [ ]:
In [ ]: