Skip to content

Commit

Permalink
Deploying to gh-pages from @ 69d6461 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
github-merge-queue[bot] committed Feb 29, 2024
1 parent 6b742d5 commit 9c222bd
Show file tree
Hide file tree
Showing 12 changed files with 398 additions and 107 deletions.
52 changes: 29 additions & 23 deletions _modules/arkouda/dataframe.html

Large diffs are not rendered by default.

146 changes: 127 additions & 19 deletions _modules/arkouda/index.html

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions _modules/arkouda/series.html
Original file line number Diff line number Diff line change
Expand Up @@ -971,10 +971,15 @@ <h1>Source code for arkouda.series</h1><div class="highlight"><pre>
<span class="nd">@typechecked</span>
<span class="k">def</span> <span class="nf">to_pandas</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Convert the series to a local PANDAS series&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">copy</span>
<span class="n">idx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">index</span><span class="o">.</span><span class="n">to_pandas</span><span class="p">()</span>
<span class="n">val</span> <span class="o">=</span> <span class="n">convert_if_categorical</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">values</span><span class="p">)</span>
<span class="k">return</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="n">val</span><span class="o">.</span><span class="n">to_ndarray</span><span class="p">(),</span> <span class="n">index</span><span class="o">=</span><span class="n">idx</span><span class="p">)</span></div>

<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="n">name</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
<span class="k">return</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="n">val</span><span class="o">.</span><span class="n">to_ndarray</span><span class="p">(),</span> <span class="n">index</span><span class="o">=</span><span class="n">idx</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="n">val</span><span class="o">.</span><span class="n">to_ndarray</span><span class="p">(),</span> <span class="n">index</span><span class="o">=</span><span class="n">idx</span><span class="p">)</span></div>


<div class="viewcode-block" id="Series.to_list">
Expand Down
10 changes: 7 additions & 3 deletions _modules/arkouda/util.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@
</div>
<article role="main">
<h1>Source code for arkouda.util</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">cast</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">,</span> <span class="n">Sequence</span>
<span></span><span class="kn">import</span> <span class="nn">json</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Sequence</span><span class="p">,</span> <span class="n">Tuple</span><span class="p">,</span> <span class="n">cast</span>
<span class="kn">from</span> <span class="nn">warnings</span> <span class="kn">import</span> <span class="n">warn</span>
<span class="kn">import</span> <span class="nn">json</span>

<span class="kn">from</span> <span class="nn">typeguard</span> <span class="kn">import</span> <span class="n">typechecked</span>

Expand Down Expand Up @@ -347,6 +347,10 @@ <h1>Source code for arkouda.util</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">types</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Items must all have same type: </span><span class="si">{</span><span class="n">types</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">t</span> <span class="o">=</span> <span class="n">types</span><span class="o">.</span><span class="n">pop</span><span class="p">()</span>

<span class="k">if</span> <span class="n">t</span> <span class="ow">is</span> <span class="nb">list</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[</span><span class="n">x</span> <span class="k">for</span> <span class="n">lst</span> <span class="ow">in</span> <span class="n">items</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">lst</span><span class="p">]</span>

<span class="k">return</span> <span class="p">(</span>
<span class="n">t</span><span class="o">.</span><span class="n">concat</span><span class="p">(</span><span class="n">items</span><span class="p">,</span> <span class="n">ordered</span><span class="o">=</span><span class="n">ordered</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">t</span><span class="p">,</span> <span class="s2">&quot;concat&quot;</span><span class="p">)</span>
Expand Down Expand Up @@ -491,8 +495,8 @@ <h1>Source code for arkouda.util</h1><div class="highlight"><pre>
<span class="nd">@typechecked</span>
<span class="k">def</span> <span class="nf">attach</span><span class="p">(</span><span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="kn">from</span> <span class="nn">arkouda.dataframe</span> <span class="kn">import</span> <span class="n">DataFrame</span>
<span class="kn">from</span> <span class="nn">arkouda.pdarrayclass</span> <span class="kn">import</span> <span class="n">pdarray</span>
<span class="kn">from</span> <span class="nn">arkouda.index</span> <span class="kn">import</span> <span class="n">Index</span><span class="p">,</span> <span class="n">MultiIndex</span>
<span class="kn">from</span> <span class="nn">arkouda.pdarrayclass</span> <span class="kn">import</span> <span class="n">pdarray</span>
<span class="kn">from</span> <span class="nn">arkouda.series</span> <span class="kn">import</span> <span class="n">Series</span>

<span class="n">rep_msg</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">cast</span><span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="n">generic_msg</span><span class="p">(</span><span class="n">cmd</span><span class="o">=</span><span class="s2">&quot;attach&quot;</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="n">name</span><span class="p">})))</span>
Expand Down
8 changes: 4 additions & 4 deletions _sources/autoapi/arkouda/dataframe/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ Functions

.. py:property:: columns
A list of column names of the dataframe.
An Index where the values are the column names of the dataframe.

:returns: A list of column names of the dataframe.
:rtype: list of str
:returns: The values of the index are the column names of the dataframe.
:rtype: arkouda.index.Index

.. rubric:: Examples

Expand All @@ -198,7 +198,7 @@ Functions
+----+--------+--------+

>>> df.columns
['col1', 'col2']
Index(array(['col1', 'col2']), dtype='<U0')

.. py:property:: dtypes
Expand Down
62 changes: 47 additions & 15 deletions _sources/autoapi/arkouda/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,10 @@ Attributes

.. py:property:: columns

A list of column names of the dataframe.
An Index where the values are the column names of the dataframe.

:returns: A list of column names of the dataframe.
:rtype: list of str
:returns: The values of the index are the column names of the dataframe.
:rtype: arkouda.index.Index

.. rubric:: Examples

Expand All @@ -845,7 +845,7 @@ Attributes
+----+--------+--------+

>>> df.columns
['col1', 'col2']
Index(array(['col1', 'col2']), dtype='<U0')

.. py:property:: dtypes

Expand Down Expand Up @@ -3066,10 +3066,10 @@ Attributes

.. py:property:: columns

A list of column names of the dataframe.
An Index where the values are the column names of the dataframe.

:returns: A list of column names of the dataframe.
:rtype: list of str
:returns: The values of the index are the column names of the dataframe.
:rtype: arkouda.index.Index

.. rubric:: Examples

Expand All @@ -3087,7 +3087,7 @@ Attributes
+----+--------+--------+

>>> df.columns
['col1', 'col2']
Index(array(['col1', 'col2']), dtype='<U0')

.. py:property:: dtypes

Expand Down Expand Up @@ -10585,7 +10585,7 @@ Attributes



.. py:class:: Index(values: Union[List, arkouda.pdarrayclass.pdarray, arkouda.Strings, arkouda.Categorical, pandas.Index, Index], name: Optional[str] = None)
.. py:class:: Index(values: Union[List, arkouda.pdarrayclass.pdarray, arkouda.Strings, arkouda.Categorical, pandas.Index, Index], name: Optional[str] = None, allow_list=False, max_list_size=1000)


.. py:property:: index
Expand All @@ -10603,7 +10603,34 @@ Attributes
.. py:attribute:: objType
:value: 'Index'


Sequence used for indexing and alignment.

The basic object storing axis labels for all DataFrame objects.

:param values:
:type values: List, pdarray, Strings, Categorical, pandas.Index, or Index
:param name: Name to be stored in the index.
:type name: str, default=None
:param allow_list = False: If False, list values will be converted to a pdarray.
If True, list values will remain as a list, provided the data length is less than max_list_size.
:param : If False, list values will be converted to a pdarray.
If True, list values will remain as a list, provided the data length is less than max_list_size.
:param max_list_size = 1000: This is the maximum allowed data length for the values to be stored as a list object.

:raises ValueError: Raised if allow_list=True and the size of values is > max_list_size.

.. seealso:: :obj:`MultiIndex`

.. rubric:: Examples

>>> ak.Index([1, 2, 3])
Index(array([1 2 3]), dtype='int64')

>>> ak.Index(list('abc'))
Index(array(['a', 'b', 'c']), dtype='<U0')

>>> ak.Index([1, 2, 3], allow_list=True)
Index([1, 2, 3], dtype='int64')

.. py:method:: argsort(ascending=True)

Expand Down Expand Up @@ -10699,7 +10726,8 @@ Attributes
file write location or if the mode parameter is neither truncate
nor append
:raises TypeError: Raised if any one of the prefix_path, dataset, or mode parameters
is not a string
is not a string.
Raised if the Index values are a list.

.. seealso:: :obj:`save_all`, :obj:`load`, :obj:`read`, :obj:`to_parquet`, :obj:`to_hdf`

Expand Down Expand Up @@ -10753,13 +10781,14 @@ Attributes
------
ValueError
Raised if all datasets are not present in all parquet files or if one or
more of the specified files do not exist
more of the specified files do not exist.
RuntimeError
Raised if one or more of the specified files cannot be opened.
If `allow_errors` is true this may be raised if no values are returned
from the server.
TypeError
Raised if we receive an unknown arkouda_type returned from the server
Raised if we receive an unknown arkouda_type returned from the server.
Raised if the Index values are a list.

Notes
------
Expand Down Expand Up @@ -10794,6 +10823,7 @@ Attributes
:rtype: string message indicating result of save operation

:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray
:raises TypeError: Raised if the Index values are a list.

.. rubric:: Notes

Expand Down Expand Up @@ -10839,6 +10869,7 @@ Attributes
:rtype: string message indicating result of save operation

:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray
:raises TypeError: Raised if the Index values are a list.

.. rubric:: Notes

Expand Down Expand Up @@ -11014,7 +11045,7 @@ Attributes
Currently only aku.ip_address and ak.array are supported.


.. py:method:: to_dict(labels)
.. py:method:: to_dict(labels=None)


.. py:method:: to_hdf(prefix_path: str, dataset: str = 'index', mode: str = 'truncate', file_type: str = 'distribute') -> str
Expand All @@ -11036,7 +11067,7 @@ Attributes

:rtype: string message indicating result of save operation

:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray
:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray.

.. rubric:: Notes

Expand Down Expand Up @@ -11097,6 +11128,7 @@ Attributes
:rtype: str - success message if successful

:raises RuntimeError: Raised if a server-side error is thrown saving the index
:raises TypeError: Raised if the Index values are a list.

.. rubric:: Notes

Expand Down
46 changes: 39 additions & 7 deletions _sources/autoapi/arkouda/index/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Classes



.. py:class:: Index(values: Union[List, arkouda.pdarrayclass.pdarray, arkouda.Strings, arkouda.Categorical, pandas.Index, Index], name: Optional[str] = None)
.. py:class:: Index(values: Union[List, arkouda.pdarrayclass.pdarray, arkouda.Strings, arkouda.Categorical, pandas.Index, Index], name: Optional[str] = None, allow_list=False, max_list_size=1000)
.. py:property:: index
Expand All @@ -36,7 +36,34 @@ Classes
.. py:attribute:: objType
:value: 'Index'


Sequence used for indexing and alignment.

The basic object storing axis labels for all DataFrame objects.

:param values:
:type values: List, pdarray, Strings, Categorical, pandas.Index, or Index
:param name: Name to be stored in the index.
:type name: str, default=None
:param allow_list = False: If False, list values will be converted to a pdarray.
If True, list values will remain as a list, provided the data length is less than max_list_size.
:param : If False, list values will be converted to a pdarray.
If True, list values will remain as a list, provided the data length is less than max_list_size.
:param max_list_size = 1000: This is the maximum allowed data length for the values to be stored as a list object.

:raises ValueError: Raised if allow_list=True and the size of values is > max_list_size.

.. seealso:: :obj:`MultiIndex`

.. rubric:: Examples

>>> ak.Index([1, 2, 3])
Index(array([1 2 3]), dtype='int64')

>>> ak.Index(list('abc'))
Index(array(['a', 'b', 'c']), dtype='<U0')

>>> ak.Index([1, 2, 3], allow_list=True)
Index([1, 2, 3], dtype='int64')

.. py:method:: argsort(ascending=True)
Expand Down Expand Up @@ -132,7 +159,8 @@ Classes
file write location or if the mode parameter is neither truncate
nor append
:raises TypeError: Raised if any one of the prefix_path, dataset, or mode parameters
is not a string
is not a string.
Raised if the Index values are a list.

.. seealso:: :obj:`save_all`, :obj:`load`, :obj:`read`, :obj:`to_parquet`, :obj:`to_hdf`

Expand Down Expand Up @@ -186,13 +214,14 @@ Classes
------
ValueError
Raised if all datasets are not present in all parquet files or if one or
more of the specified files do not exist
more of the specified files do not exist.
RuntimeError
Raised if one or more of the specified files cannot be opened.
If `allow_errors` is true this may be raised if no values are returned
from the server.
TypeError
Raised if we receive an unknown arkouda_type returned from the server
Raised if we receive an unknown arkouda_type returned from the server.
Raised if the Index values are a list.
Notes
------
Expand Down Expand Up @@ -227,6 +256,7 @@ Classes
:rtype: string message indicating result of save operation
:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray
:raises TypeError: Raised if the Index values are a list.
.. rubric:: Notes
Expand Down Expand Up @@ -272,6 +302,7 @@ Classes
:rtype: string message indicating result of save operation
:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray
:raises TypeError: Raised if the Index values are a list.
.. rubric:: Notes
Expand Down Expand Up @@ -407,7 +438,7 @@ Classes
Currently only aku.ip_address and ak.array are supported.
.. py:method:: to_dict(labels)
.. py:method:: to_dict(labels=None)
.. py:method:: to_hdf(prefix_path: str, dataset: str = 'index', mode: str = 'truncate', file_type: str = 'distribute') -> str
Expand All @@ -429,7 +460,7 @@ Classes
:rtype: string message indicating result of save operation
:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray
:raises RuntimeError: Raised if a server-side error is thrown saving the pdarray.
.. rubric:: Notes
Expand Down Expand Up @@ -490,6 +521,7 @@ Classes
:rtype: str - success message if successful
:raises RuntimeError: Raised if a server-side error is thrown saving the index
:raises TypeError: Raised if the Index values are a list.
.. rubric:: Notes
Expand Down
8 changes: 4 additions & 4 deletions autoapi/arkouda/dataframe/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -642,13 +642,13 @@ <h3>Functions<a class="headerlink" href="#functions" title="Link to this heading
<dl class="py property">
<dt class="sig sig-object py" id="arkouda.dataframe.DataFrame.columns">
<em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">columns</span></span><a class="headerlink" href="#arkouda.dataframe.DataFrame.columns" title="Link to this definition">#</a></dt>
<dd><p>A list of column names of the dataframe.</p>
<dd><p>An Index where the values are the column names of the dataframe.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>A list of column names of the dataframe.</p>
<dd class="field-odd"><p>The values of the index are the column names of the dataframe.</p>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p>list of str</p>
<dd class="field-even"><p><a class="reference internal" href="../index/index.html#arkouda.index.Index" title="arkouda.index.Index">arkouda.index.Index</a></p>
</dd>
</dl>
<p class="rubric">Examples</p>
Expand Down Expand Up @@ -679,7 +679,7 @@ <h3>Functions<a class="headerlink" href="#functions" title="Link to this heading
</table>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">df</span><span class="o">.</span><span class="n">columns</span>
<span class="go">[&#39;col1&#39;, &#39;col2&#39;]</span>
<span class="go">Index(array([&#39;col1&#39;, &#39;col2&#39;]), dtype=&#39;&lt;U0&#39;)</span>
</pre></div>
</div>
</dd></dl>
Expand Down
Loading

0 comments on commit 9c222bd

Please sign in to comment.