Files
pylib/docs/build/html/data.html

270 lines
11 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>data module &#8212; pylib 2019.5.19 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-data">
<span id="data-module"></span><h1>data module<a class="headerlink" href="#module-data" title="Permalink to this headline"></a></h1>
<p>Read and write data to or from file and manipulate data structures.</p>
<dl class="field-list simple">
<dt class="field-odd">Date</dt>
<dd class="field-odd"><p>2019-10-11</p>
</dd>
</dl>
<span class="target" id="module-data"></span><dl class="function">
<dt id="data.fold_list">
<code class="sig-name descname">fold_list</code><span class="sig-paren">(</span><em class="sig-param">lst</em>, <em class="sig-param">n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#fold_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.fold_list" title="Permalink to this definition"></a></dt>
<dd><p>Convert one-dimensional kx1 array (list) to two-dimensional mxn
array. m = k / n</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lst</strong> (<em>list</em>) list to convert</p></li>
<li><p><strong>n</strong> (<em>int</em>) length of the second dimenson</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>two-dimensional array (list of lists)</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.get_id">
<code class="sig-name descname">get_id</code><span class="sig-paren">(</span><em class="sig-param">ids</em>, <em class="sig-param">uide</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#get_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.get_id" title="Permalink to this definition"></a></dt>
<dd><p>Get full id from unique id ending.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ids</strong> (<em>list</em>) ids</p></li>
<li><p><strong>uide</strong> (<em>str</em>) unique id ending</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>full id</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str or int</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.load">
<code class="sig-name descname">load</code><span class="sig-paren">(</span><em class="sig-param">file_name</em>, <em class="sig-param">default=None</em>, <em class="sig-param">verbose=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.load" title="Permalink to this definition"></a></dt>
<dd><p>Load stored program objects from binary file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file_name</strong> (<em>str</em>) file to load</p></li>
<li><p><strong>default</strong> (<em>object</em>) return object if data loading fails</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) verbose information (default = False)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>loaded data</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>object</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.read">
<code class="sig-name descname">read</code><span class="sig-paren">(</span><em class="sig-param">file_name</em>, <em class="sig-param">x_column</em>, <em class="sig-param">y_column</em>, <em class="sig-param">default=None</em>, <em class="sig-param">verbose=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.read" title="Permalink to this definition"></a></dt>
<dd><p>Read ascii data file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> (<em>str</em>) file to read</p></li>
<li><p><strong>x_column</strong> (<em>int</em>) column index for the x data (first column is 0)</p></li>
<li><p><strong>y_column</strong> (<em>int</em>) column index for the y data (first column is 0)</p></li>
<li><p><strong>default</strong> (<em>object</em>) return object if data loading fails</p></li>
<li><p><strong>verbose</strong> (<em>bool</em>) verbose information (default = False)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>x and y</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple(list, list)</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.seq">
<code class="sig-name descname">seq</code><span class="sig-paren">(</span><em class="sig-param">start</em>, <em class="sig-param">stop=None</em>, <em class="sig-param">step=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#seq"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.seq" title="Permalink to this definition"></a></dt>
<dd><p>Create an arithmetic bounded sequence.</p>
<p>The sequence is one of the following;</p>
<ul class="simple">
<li><p>empty <span class="math notranslate nohighlight">\(\{\}=\emptyset\)</span>, if start and stop are the same</p></li>
<li><p>degenerate <span class="math notranslate nohighlight">\(\{a\}\)</span>, if the sequence has only one element.</p></li>
<li><p>left-close and right-open <span class="math notranslate nohighlight">\([a, b)\)</span></p></li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>start</strong> (<em>int</em><em> or </em><em>float</em>) start of the sequence, the lower bound. If only start
is given than it is interpreted as stop and start will be 0.</p></li>
<li><p><strong>stop</strong> (<em>int</em><em> or </em><em>float</em>) stop of sequence, the upper bound.</p></li>
<li><p><strong>step</strong> (<em>int</em><em> or </em><em>float</em>) step size, the common difference (constant difference
between consecutive terms).</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>arithmetic bounded sequence</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.store">
<code class="sig-name descname">store</code><span class="sig-paren">(</span><em class="sig-param">file_name</em>, <em class="sig-param">object_data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#store"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.store" title="Permalink to this definition"></a></dt>
<dd><p>Store program objects to binary file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file_name</strong> (<em>str</em>) file to store</p></li>
<li><p><strong>object_data</strong> (<em>object</em>) data to store</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.unique_ending">
<code class="sig-name descname">unique_ending</code><span class="sig-paren">(</span><em class="sig-param">ids</em>, <em class="sig-param">n=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#unique_ending"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.unique_ending" title="Permalink to this definition"></a></dt>
<dd><p>From id list get list with unique ending.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ids</strong> (<em>list</em>) ids</p></li>
<li><p><strong>n</strong> (<em>int</em>) minumum chars or ints</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>unique ending of ids</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="data.write">
<code class="sig-name descname">write</code><span class="sig-paren">(</span><em class="sig-param">file_name</em>, <em class="sig-param">data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/data.html#write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#data.write" title="Permalink to this definition"></a></dt>
<dd><p>Write ascii file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file_name</strong> (<em>str</em>) file to write</p></li>
<li><p><strong>data</strong> (<em>str</em>) data to write</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">pylib</a></h1>
<h3>Navigation</h3>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2019, Daniel Weschke.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/data.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>