itertools accumulate

davidcullen's Avatar

davidcullen

03 May, 2019 04:14 AM

I may have missed something obvious but...
I have 2 simple lines of python code (only):

import itertools
a = itertools.accumulate([1,2,3,4,5])
which should work (I think) but it does not. I get an error message:
'AttributeError: type object 'itertools' has no attribute 'accumulate'
What am I doing incorrectly?
  1. 1 Posted by hleofxquotes on 04 May, 2019 01:44 AM

    hleofxquotes's Avatar

    I believe accumulate() is only available in Python 3. The embedded Jython interpreter in MD only support Python 2.

  2. 2 Posted by davidcullen on 05 May, 2019 12:43 AM

    davidcullen's Avatar

    That would explain it, thanks. Can’t wait for md to update to Python 3!

  3. davidcullen closed this discussion on 05 May, 2019 12:43 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac