inside the data module rename read to read_columns add add new read function to read the whole file as string. add print_list function to print one element per line. add unique_list and unique_list_hashable to reduce the list into a unique list with same order. add find_last, str_between, str_to_list functions. inside the mathematics module for vector add normalized creating a new object (normalize will change the object), isclose and iscloseto, change ang to round internal number. for matrix improve slicing and add transposed creating a new object (transpose will change object). inside the function module add b_spline_basis, b_spline_curve_with_knots and b_spline_knots functions. add sample_hal_open and sample_half_open_seq. add circle and ellipse. inside the geometry module change CS init from using lists to Directions and add new constructor CS.init_xzy using lists. rename Wireframe to Polyline. add classes B_spline_curve_with_knots, Ellipse, ArcCircle, ArcEllipse, ArcBSplineCurveWithKnots. add function sample_half_open to create a list of Points. inside the geometry_plot_pylab module change the help text. add step_and data data_step_std module to read a step file to list and draw the content. add helper module with context manager and decorator timeit to meassure the time for a section or function. add example for b_spline function.
445 lines
23 KiB
HTML
445 lines
23 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>pylib.data module — pylib 2019.12.21 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="next" title="pylib.data_step module" href="pylib.data_step.html" />
|
||
<link rel="prev" title="pylib.numerical.ode_model module" href="pylib.numerical.ode_model.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-pylib.data">
|
||
<span id="pylib-data-module"></span><h1>pylib.data module<a class="headerlink" href="#module-pylib.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-12-28</p>
|
||
</dd>
|
||
</dl>
|
||
<span class="target" id="module-data"></span><dl class="function">
|
||
<dt id="pylib.data.find_last">
|
||
<code class="sig-name descname">find_last</code><span class="sig-paren">(</span><em class="sig-param">sequence</em>, <em class="sig-param">pattern</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#find_last"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.find_last" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Find last last occurance in sequence (text)</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>sequence</strong> (<em>str</em>) – text to search in</p></li>
|
||
<li><p><strong>pattern</strong> (<em>str</em>) – search pattern</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>index (-1 if pattern not in sequence)</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>int</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.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/pylib/data.html#fold_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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="pylib.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/pylib/data.html#get_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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="pylib.data.issequence">
|
||
<code class="sig-name descname">issequence</code><span class="sig-paren">(</span><em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#issequence"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.issequence" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>True for tuple, list, str
|
||
False for int, dict, set</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Example</dt>
|
||
<dd class="field-odd"><p></p></dd>
|
||
</dl>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">issequence</span><span class="p">(())</span>
|
||
<span class="go">True</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span> <span class="p">))</span>
|
||
<span class="go">True</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">([])</span>
|
||
<span class="go">True</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">([</span><span class="mi">1</span><span class="p">])</span>
|
||
<span class="go">True</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">])</span>
|
||
<span class="go">True</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">(</span><span class="s1">''</span><span class="p">)</span>
|
||
<span class="go">True</span>
|
||
</pre></div>
|
||
</div>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">issequence</span><span class="p">((</span><span class="mi">3</span><span class="p">))</span>
|
||
<span class="go">False</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">({})</span>
|
||
<span class="go">False</span>
|
||
<span class="gp">>>> </span><span class="n">issequence</span><span class="p">(</span><span class="nb">set</span><span class="p">())</span>
|
||
<span class="go">False</span>
|
||
</pre></div>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.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/pylib/data.html#load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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="pylib.data.print_list">
|
||
<code class="sig-name descname">print_list</code><span class="sig-paren">(</span><em class="sig-param">lst</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#print_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.print_list" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Print list, one list element per line.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><p><strong>lst</strong> (<em>list</em>) – list to print</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.data.read">
|
||
<code class="sig-name descname">read</code><span class="sig-paren">(</span><em class="sig-param">file_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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"><p><strong>filename</strong> (<em>str</em>) – file to read</p>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>file content</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>str</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.data.read_columns">
|
||
<code class="sig-name descname">read_columns</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/pylib/data.html#read_columns"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.read_columns" 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>file_name</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="pylib.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/pylib/data.html#seq"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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="pylib.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/pylib/data.html#store"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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="pylib.data.str_between">
|
||
<code class="sig-name descname">str_between</code><span class="sig-paren">(</span><em class="sig-param">text</em>, <em class="sig-param">left</em>, <em class="sig-param">right</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#str_between"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.str_between" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Get text between two pattern.</p>
|
||
<p>Text can be multi-line.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>text</strong> (<em>str</em>) – text to search in</p></li>
|
||
<li><p><strong>left</strong> (<em>str</em>) – left pattern</p></li>
|
||
<li><p><strong>right</strong> (<em>str</em>) – right pattern</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>text between the left and right pattern</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>str</p>
|
||
</dd>
|
||
</dl>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.data.str_to_list">
|
||
<code class="sig-name descname">str_to_list</code><span class="sig-paren">(</span><em class="sig-param">string</em>, <em class="sig-param">delimiter=';\n'</em>, <em class="sig-param">newline_replacement=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#str_to_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.str_to_list" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>Converts a string with block information into a list.</p>
|
||
<p>This function un-wraps multi-line block information into one line.</p>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Parameters</dt>
|
||
<dd class="field-odd"><ul class="simple">
|
||
<li><p><strong>string</strong> (<em>str</em>) – string with block information</p></li>
|
||
<li><p><strong>delimiter</strong> (<em>str</em>) – block delimiter (default = ‘;n’). This will be
|
||
removed from the resulting list.</p></li>
|
||
<li><p><strong>newline_replacement</strong> (<em>str</em>) – block lines replacement (default = ‘’)</p></li>
|
||
</ul>
|
||
</dd>
|
||
<dt class="field-even">Returns</dt>
|
||
<dd class="field-even"><p>list of block information</p>
|
||
</dd>
|
||
<dt class="field-odd">Return type</dt>
|
||
<dd class="field-odd"><p>list</p>
|
||
</dd>
|
||
</dl>
|
||
<div class="admonition note">
|
||
<p class="admonition-title">Note</p>
|
||
<p>Every line is left striped. Empty line are ignored.</p>
|
||
</div>
|
||
<dl class="field-list simple">
|
||
<dt class="field-odd">Example</dt>
|
||
<dd class="field-odd"><p></p></dd>
|
||
</dl>
|
||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">before</span> <span class="p">(</span><span class="n">string</span><span class="p">):</span>
|
||
<span class="n">FILE_DESCRIPTION</span><span class="p">((</span><span class="s1">'Open CASCADE Model'</span><span class="p">),</span><span class="s1">'2;1'</span><span class="p">);</span>
|
||
<span class="n">FILE_NAME</span><span class="p">(</span><span class="s1">'Open CASCADE Shape Model'</span><span class="p">,</span><span class="s1">'2019-10-14T14:32:20'</span><span class="p">,(</span><span class="s1">'Author'</span><span class="p">),(</span>
|
||
<span class="s1">'Open CASCADE'</span><span class="p">),</span><span class="s1">'Open CASCADE STEP processor 7.1'</span><span class="p">,</span><span class="s1">'Open CASCADE 7.1'</span>
|
||
<span class="p">,</span><span class="s1">'Unknown'</span><span class="p">);</span>
|
||
<span class="n">FILE_SCHEMA</span><span class="p">((</span><span class="s1">'AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'</span><span class="p">));</span>
|
||
|
||
<span class="n">after</span> <span class="p">(</span><span class="nb">list</span> <span class="n">elements</span> <span class="n">one</span> <span class="n">per</span> <span class="n">line</span><span class="p">):</span>
|
||
<span class="n">FILE_DESCRIPTION</span><span class="p">((</span><span class="s1">'Open CASCADE Model'</span><span class="p">),</span><span class="s1">'2;1'</span><span class="p">)</span>
|
||
<span class="n">FILE_NAME</span><span class="p">(</span><span class="s1">'Open CASCADE Shape Model'</span><span class="p">,</span><span class="s1">'2019-10-14T14:32:20'</span><span class="p">,(</span><span class="s1">'Author'</span><span class="p">),(</span><span class="s1">'Open CASCADE'</span><span class="p">),</span><span class="s1">'Open CASCADE STEP processor 7.1'</span><span class="p">,</span><span class="s1">'Open CASCADE 7.1'</span><span class="p">,</span><span class="s1">'Unknown'</span><span class="p">)</span>
|
||
<span class="n">FILE_SCHEMA</span><span class="p">((</span><span class="s1">'AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'</span><span class="p">))</span>
|
||
</pre></div>
|
||
</div>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.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/pylib/data.html#unique_ending"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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="pylib.data.unique_list">
|
||
<code class="sig-name descname">unique_list</code><span class="sig-paren">(</span><em class="sig-param">sequence</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#unique_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.unique_list" title="Permalink to this definition">¶</a></dt>
|
||
<dd></dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.data.unique_list_hashable">
|
||
<code class="sig-name descname">unique_list_hashable</code><span class="sig-paren">(</span><em class="sig-param">sequence</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylib/data.html#unique_list_hashable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.data.unique_list_hashable" title="Permalink to this definition">¶</a></dt>
|
||
<dd><p>faster using set() but elements of the sequence must be hashable.
|
||
unhashable types: ‘list’</p>
|
||
</dd></dl>
|
||
|
||
<dl class="function">
|
||
<dt id="pylib.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/pylib/data.html#write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylib.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>
|
||
<p class="caption"><span class="caption-text">Contents:</span></p>
|
||
<ul class="current">
|
||
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">pylib</a><ul class="current">
|
||
<li class="toctree-l2 current"><a class="reference internal" href="pylib.html">pylib package</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="index.html">Documentation overview</a><ul>
|
||
<li><a href="modules.html">pylib</a><ul>
|
||
<li><a href="pylib.html">pylib package</a><ul>
|
||
<li>Previous: <a href="pylib.numerical.ode_model.html" title="previous chapter">pylib.numerical.ode_model module</a></li>
|
||
<li>Next: <a href="pylib.data_step.html" title="next chapter">pylib.data_step module</a></li>
|
||
</ul></li>
|
||
</ul></li>
|
||
</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">
|
||
©2019, Daniel Weschke.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 2.2.1</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||
|
||
|
|
||
<a href="_sources/pylib.data.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
|
||
|
||
</body>
|
||
</html> |