Latest recipes tagged "analysis"http://code.activestate.com/recipes/tags/analysis/new/2015-02-10T13:34:48-08:00ActiveState Code RecipesSimple FIFO trading model for pnl (Python) 2015-02-10T13:34:48-08:00alexander bakerhttp://code.activestate.com/recipes/users/4166679/http://code.activestate.com/recipes/579024-simple-fifo-trading-model-for-pnl/ <p style="color: grey"> Python recipe 579024 by <a href="/recipes/users/4166679/">alexander baker</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/pnl/">pnl</a>, <a href="/recipes/tags/trading/">trading</a>). Revision 2. </p> <p>Simple approach to calculating FIFO pnl.</p> Numerical Inversion of the Laplace Transform with mpmath (Python) 2013-12-27T05:10:12-08:00Pawel Olejnikhttp://code.activestate.com/recipes/users/4188852/http://code.activestate.com/recipes/578799-numerical-inversion-of-the-laplace-transform-with-/ <p style="color: grey"> Python recipe 578799 by <a href="/recipes/users/4188852/">Pawel Olejnik</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/mpmath/">mpmath</a>, <a href="/recipes/tags/numerical/">numerical</a>). </p> <p>This Recipe is a variant of <a href="http://code.activestate.com/recipes/576934/">recipe 576934</a>: Numerical Inversion of the Laplace Transform using the Talbot method by Fernando Damian Nieuwveldt adapted to high precision mpmath</p> Python code clone detector (Don't Repeat Yourself) (Python) 2012-07-12T14:59:11-07:00frahttp://code.activestate.com/recipes/users/4182629/http://code.activestate.com/recipes/578206-python-code-clone-detector-dont-repeat-yourself/ <p style="color: grey"> Python recipe 578206 by <a href="/recipes/users/4182629/">fra</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/clone/">clone</a>, <a href="/recipes/tags/code/">code</a>, <a href="/recipes/tags/dry/">dry</a>, <a href="/recipes/tags/duplication/">duplication</a>, <a href="/recipes/tags/parse/">parse</a>, <a href="/recipes/tags/similarity/">similarity</a>, <a href="/recipes/tags/static/">static</a>, <a href="/recipes/tags/syntax/">syntax</a>). Revision 2. </p> <p>Find duplicate code in Python 2/3 source files. Write a nice report about it.</p> <p>Works at the Abstract Syntax Tree level, which is a robust way to detect clones. See this <a href="http://francois.boutines.free.fr/python-3.2-report.html">code duplicated in the Python 3.2 standard library</a>.</p> <p><strong>Update</strong>: I cleaned the code a little bit, made it Python 2.7 compatible and faster.</p> Frequency Analyser (Python) 2011-08-11T09:26:56-07:00Stijn de Graafhttp://code.activestate.com/recipes/users/4178055/http://code.activestate.com/recipes/577837-frequency-analyser/ <p style="color: grey"> Python recipe 577837 by <a href="/recipes/users/4178055/">Stijn de Graaf</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/analyze/">analyze</a>, <a href="/recipes/tags/character/">character</a>, <a href="/recipes/tags/cryptography/">cryptography</a>, <a href="/recipes/tags/frequency/">frequency</a>). </p> <p>Calculates the frequency of characters within a block of text. In the context of cryptography, these values can be compared to a frequency table in order to attempt to ascertain the original message.</p> DictSet - A specialized Python container datatype for managing collections of sets. (Python) 2011-05-18T21:18:54-07:00Roger Lewhttp://code.activestate.com/recipes/users/4178017/http://code.activestate.com/recipes/577702-dictset-a-specialized-python-container-datatype-fo/ <p style="color: grey"> Python recipe 577702 by <a href="/recipes/users/4178017/">Roger Lew</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/development/">development</a>, <a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/information/">information</a>, <a href="/recipes/tags/mathematics/">mathematics</a>, <a href="/recipes/tags/sets/">sets</a>). </p> <p>The basic Python container types (dict, list, set, and tuple) are extremely versatile and powerful. The collections module first implemented in Python 2.4 has shown that sub-classing these containers can yield elegant solutions to the right problem. In a similar vein this project is a dict subclass for elegantly handling collections of sets. In many aspects a DictSet is similiar to a defaultdict of sets except it generalizes many of the set operations to the dict.</p> <p>Put simply, DictSet is a dict of sets that behaves like a set.</p> <p>DictSet requires 0 non-standard dependencies and should work with Python 2.5 and up.</p> Dirt simple map/reduce (Python) 2011-05-15T16:46:55-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/577676-dirt-simple-mapreduce/ <p style="color: grey"> Python recipe 577676 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/crosstab/">crosstab</a>, <a href="/recipes/tags/functional/">functional</a>, <a href="/recipes/tags/map_reduce/">map_reduce</a>, <a href="/recipes/tags/pivot_table/">pivot_table</a>, <a href="/recipes/tags/statistics/">statistics</a>). Revision 9. </p> <p>Simple tool for analyzing datasets.</p> Numerical Inversion of the Laplace Transform with mpmath (Python) 2009-10-27T01:48:22-07:00Dieter Kadelkahttp://code.activestate.com/recipes/users/4172107/http://code.activestate.com/recipes/576938-numerical-inversion-of-the-laplace-transform-with-/ <p style="color: grey"> Python recipe 576938 by <a href="/recipes/users/4172107/">Dieter Kadelka</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/mpmath/">mpmath</a>, <a href="/recipes/tags/numerical/">numerical</a>). </p> <p>This Recipe is a variant of <a href="http://code.activestate.com/recipes/576934/">recipe 576934</a>: Numerical Inversion of the Laplace Transform using the Talbot method by Fernando Damian Nieuwveldt adapted to high precision mpmath</p> Numerical Inversion of the Laplace Transform using the Talbot method. (Python) 2009-10-27T04:53:30-07:00Fernando Nieuwveldthttp://code.activestate.com/recipes/users/4172088/http://code.activestate.com/recipes/576934-numerical-inversion-of-the-laplace-transform-using/ <p style="color: grey"> Python recipe 576934 by <a href="/recipes/users/4172088/">Fernando Nieuwveldt</a> (<a href="/recipes/tags/analysis/">analysis</a>, <a href="/recipes/tags/laplace/">laplace</a>, <a href="/recipes/tags/numerical/">numerical</a>). Revision 5. </p> <p>This is a fast and highly accurate numerical method for the inversion of the Laplace transform</p>