Commit 015d4f28 authored by Ivan Tyagov's avatar Ivan Tyagov

Another map reduce example.

parent ec299ba6
...@@ -214,3 +214,10 @@ def game_of_life(self): ...@@ -214,3 +214,10 @@ def game_of_life(self):
print_list.append(str(Z)) print_list.append(str(Z))
return '\n\n'.join(print_list) return '\n\n'.join(print_list)
def DataArray_calculateArraySliceAverageAndStore(self, start, end):
"""
Compute average on a data array slice and store result on an Active Process.
"""
zarray = self.getArray()
return np.average(zarray[start:end])
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>DataArray_calculateArraySliceAverageAndStore</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>WendelinExamples</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DataArray_calculateArraySliceAverageAndStore</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment