Popular recipes tagged "meta:loc=162"http://code.activestate.com/recipes/tags/meta:loc=162/2013-03-06T17:33:32-08:00ActiveState Code RecipesRunning median, mean and mode (Python) 2013-03-06T17:33:32-08:00Virgil Stokeshttp://code.activestate.com/recipes/users/4183795/http://code.activestate.com/recipes/578480-running-median-mean-and-mode/ <p style="color: grey"> Python recipe 578480 by <a href="/recipes/users/4183795/">Virgil Stokes</a> (<a href="/recipes/tags/mean/">mean</a>, <a href="/recipes/tags/median/">median</a>, <a href="/recipes/tags/mode/">mode</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/running/">running</a>). </p> <p>The following is a small contribution that I hope can be useful to Python programmers for the calculation of the running median, mean and mode. It is important to note that all the "running" calculations are done for full windows. Here is a simple example:</p> <p>y = [1, 2, 3, 3, 1, 4], with a sliding window of size = 3 for the running estimations, means = 2, 2.6667, 2.3333, 2.6667 medians = 2, 3, 3, 3 modes = 1, 3, 3, 1</p> Simple Back-propagation Neural Network in Python source code (Python) 2012-05-30T17:09:49-07:00David Adlerhttp://code.activestate.com/recipes/users/4182015/http://code.activestate.com/recipes/578148-simple-back-propagation-neural-network-in-python-s/ <p style="color: grey"> Python recipe 578148 by <a href="/recipes/users/4182015/">David Adler</a> (<a href="/recipes/tags/back/">back</a>, <a href="/recipes/tags/back_propagation/">back_propagation</a>, <a href="/recipes/tags/neural/">neural</a>, <a href="/recipes/tags/neural_network/">neural_network</a>, <a href="/recipes/tags/propagation/">propagation</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>This is a slightly different version of this <a href="http://arctrix.com/nas/python/bpnn.py" rel="nofollow">http://arctrix.com/nas/python/bpnn.py</a></p> Backpropagation-ANGN source code (Python) 2012-10-03T20:59:44-07:00David Adlerhttp://code.activestate.com/recipes/users/4182015/http://code.activestate.com/recipes/578278-backpropagation-angn-source-code/ <p style="color: grey"> Python recipe 578278 by <a href="/recipes/users/4182015/">David Adler</a> . Revision 3. </p> <p>NONE</p> Gravity Simulation Fractal Applet (Java) 2010-03-26T17:49:13-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/577152-gravity-simulation-fractal-applet/ <p style="color: grey"> Java recipe 577152 by <a href="/recipes/users/4172570/">FB36</a> (<a href="/recipes/tags/applet/">applet</a>, <a href="/recipes/tags/fractal/">fractal</a>, <a href="/recipes/tags/graphics/">graphics</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/physics/">physics</a>). </p> <p>It produces a fractal image from an N particle gravity simulation. Warning: The calculation takes about a minute!</p> Viewing embedded pictures within docstrings (Python) 2008-10-15T01:27:26-07:00Andre Robergehttp://code.activestate.com/recipes/users/2467063/http://code.activestate.com/recipes/576538-viewing-embedded-pictures-within-docstrings/ <p style="color: grey"> Python recipe 576538 by <a href="/recipes/users/2467063/">Andre Roberge</a> (<a href="/recipes/tags/docstring/">docstring</a>, <a href="/recipes/tags/embedded_image/">embedded_image</a>, <a href="/recipes/tags/viewer/">viewer</a>). </p> <p>Python docstrings are textual information about objects. They can be displayed via help(obj). However, they can not contain images. This recipe allows the inclusion of images (encoded in base 64 in the Python file) inside docstrings in a transparent way. The images are indicated as "docpicture = file_name.ext" inside the docstring, and the encoded data is in variable "file_name" inside the same module.</p> sshfs mount tool (Python) 2008-06-24T07:31:22-07:00Sven Bröcklinghttp://code.activestate.com/recipes/users/4158983/http://code.activestate.com/recipes/573473-sshfs-mount-tool/ <p style="color: grey"> Python recipe 573473 by <a href="/recipes/users/4158983/">Sven Bröckling</a> . </p> <p>This script uses sshfs ans fusermount to mount ssh ressources to local filesystems. It makes it quick to mount with its function to guess a mountname.</p> Container (Python) 2011-12-02T13:54:21-08:00Fouad Teniouhttp://code.activestate.com/recipes/users/4155345/http://code.activestate.com/recipes/574428-container/ <p style="color: grey"> Python recipe 574428 by <a href="/recipes/users/4155345/">Fouad Teniou</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). Revision 10. </p> <p>Container can be used to contain sets of differents numbers and strings, and applying maths' operations such as intersection, union and other functions.</p> tkNotebook (Python) 2007-12-30T21:11:09-08:00Patrick Cossettehttp://code.activestate.com/recipes/users/4112411/http://code.activestate.com/recipes/541092-tknotebook/ <p style="color: grey"> Python recipe 541092 by <a href="/recipes/users/4112411/">Patrick Cossette</a> . </p> <p>Notebook Widget for Tkinter. Easy to use, looks like that of the notebook used in the Tkinter based Python IDLE Options Window.</p> List Tools (Python) 2004-04-14T13:24:26-07:00Runsun Panhttp://code.activestate.com/recipes/users/1521341/http://code.activestate.com/recipes/278258-list-tools/ <p style="color: grey"> Python recipe 278258 by <a href="/recipes/users/1521341/">Runsun Pan</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). </p> <p>A collection of some useful list-related functions.</p> List Tools (Python) 2004-04-14T13:24:24-07:00Runsun Panhttp://code.activestate.com/recipes/users/1521341/http://code.activestate.com/recipes/278257-list-tools/ <p style="color: grey"> Python recipe 278257 by <a href="/recipes/users/1521341/">Runsun Pan</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). </p> <p>A collection of some useful list-related functions.</p> General Class for interfacing with Windows .DLLs (Python) 2002-08-27T12:23:31-07:00Larry Bateshttp://code.activestate.com/recipes/users/651848/http://code.activestate.com/recipes/146847-general-class-for-interfacing-with-windows-dlls/ <p style="color: grey"> Python recipe 146847 by <a href="/recipes/users/651848/">Larry Bates</a> . </p> <p>When I wanted to use Python to call functions in Windows .DLL I was surprised that I had a difficult time locating the necessary information for making this happen. This is a base class that you use to define your class (and methods for each function). It uses Sam Rushings calldll, cstring and membuf modules but I think it will make interfacing with any DLL much easier for the beginner (especially for the first time).</p>