blob: 8b5ddea1ae28c3b5747ca32ae95aff04bb40f14d [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>General functions &#8212; PySpark 3.3.3 documentation</title>
<link rel="stylesheet" href="../../_static/css/index.73d71520a4ca3b99cfee5594769eaaae.css">
<link rel="stylesheet"
href="../../_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="../../_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="../../_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet"
href="../../_static/vendor/open-sans_all/1.44.1/index.css">
<link rel="stylesheet"
href="../../_static/vendor/lato_latin-ext/1.44.1/index.css">
<link rel="stylesheet" href="../../_static/basic.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="../../_static/css/pyspark.css" />
<link rel="preload" as="script" href="../../_static/js/index.3da636dd464baa7582d2.js">
<script id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/language_data.js"></script>
<script src="../../_static/copybutton.js"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
<link rel="search" title="Search" href="../../search.html" />
<link rel="next" title="pyspark.pandas.reset_option" href="api/pyspark.pandas.reset_option.html" />
<link rel="prev" title="pyspark.pandas.read_sql" href="api/pyspark.pandas.read_sql.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="en" />
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
<nav class="navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar" id="navbar-main">
<div class="container-xl">
<a class="navbar-brand" href="../../index.html">
<img src="../../_static/spark-logo-reverse.png" class="logo" alt="logo" />
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-menu" aria-controls="navbar-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar-menu" class="col-lg-9 collapse navbar-collapse">
<ul id="navbar-main-elements" class="navbar-nav mr-auto">
<li class="nav-item ">
<a class="nav-link" href="../../getting_started/index.html">Getting Started</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="../../user_guide/index.html">User Guide</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../index.html">API Reference</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="../../development/index.html">Development</a>
</li>
<li class="nav-item ">
<a class="nav-link" href="../../migration_guide/index.html">Migration Guide</a>
</li>
</ul>
<ul class="navbar-nav">
</ul>
</div>
</div>
</nav>
<div class="container-xl">
<div class="row">
<div class="col-12 col-md-3 bd-sidebar"><form class="bd-search d-flex align-items-center" action="../../search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form>
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav">
<li class="">
<a href="../pyspark.sql/index.html">Spark SQL</a>
</li>
<li class="active">
<a href="index.html">Pandas API on Spark</a>
<ul>
<li class="">
<a href="io.html">Input/Output</a>
</li>
<li class="active">
<a href="">General functions</a>
</li>
<li class="">
<a href="series.html">Series</a>
</li>
<li class="">
<a href="frame.html">DataFrame</a>
</li>
<li class="">
<a href="indexing.html">Index objects</a>
</li>
<li class="">
<a href="window.html">Window</a>
</li>
<li class="">
<a href="groupby.html">GroupBy</a>
</li>
<li class="">
<a href="ml.html">Machine Learning utilities</a>
</li>
<li class="">
<a href="extensions.html">Extensions</a>
</li>
</ul>
</li>
<li class="">
<a href="../pyspark.ss/index.html">Structured Streaming</a>
</li>
<li class="">
<a href="../pyspark.ml.html">MLlib (DataFrame-based)</a>
</li>
<li class="">
<a href="../pyspark.streaming.html">Spark Streaming</a>
</li>
<li class="">
<a href="../pyspark.mllib.html">MLlib (RDD-based)</a>
</li>
<li class="">
<a href="../pyspark.html">Spark Core</a>
</li>
<li class="">
<a href="../pyspark.resource.html">Resource Management</a>
</li>
</ul>
</nav>
</div>
<div class="d-none d-xl-block col-xl-2 bd-toc">
<div class="tocsection onthispage pt-5 pb-3">
<i class="fas fa-list"></i> On this page
</div>
<nav id="bd-toc-nav">
<ul class="nav section-nav flex-column">
<li class="nav-item toc-entry toc-h2">
<a href="#working-with-options" class="nav-link">Working with options</a>
</li>
<li class="nav-item toc-entry toc-h2">
<a href="#data-manipulations-and-sql" class="nav-link">Data manipulations and SQL</a>
</li>
<li class="nav-item toc-entry toc-h2">
<a href="#top-level-missing-data" class="nav-link">Top-level missing data</a>
</li>
<li class="nav-item toc-entry toc-h2">
<a href="#top-level-dealing-with-numeric-data" class="nav-link">Top-level dealing with numeric data</a>
</li>
<li class="nav-item toc-entry toc-h2">
<a href="#top-level-dealing-with-datetimelike-data" class="nav-link">Top-level dealing with datetimelike data</a>
</li>
</ul>
</nav>
</div>
<main class="col-12 col-md-9 col-xl-7 py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
<div>
<div class="section" id="general-functions">
<span id="api-general-functions"></span><h1>General functions<a class="headerlink" href="#general-functions" title="Permalink to this headline"></a></h1>
<div class="section" id="working-with-options">
<h2>Working with options<a class="headerlink" href="#working-with-options" title="Permalink to this headline"></a></h2>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.reset_option.html#pyspark.pandas.reset_option" title="pyspark.pandas.reset_option"><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset_option</span></code></a>(key)</p></td>
<td><p>Reset one option to their default value.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.get_option.html#pyspark.pandas.get_option" title="pyspark.pandas.get_option"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_option</span></code></a>(key[, default])</p></td>
<td><p>Retrieves the value of the specified option.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.set_option.html#pyspark.pandas.set_option" title="pyspark.pandas.set_option"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_option</span></code></a>(key, value)</p></td>
<td><p>Sets the value of the specified option.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.option_context.html#pyspark.pandas.option_context" title="pyspark.pandas.option_context"><code class="xref py py-obj docutils literal notranslate"><span class="pre">option_context</span></code></a>(*args)</p></td>
<td><p>Context manager to temporarily set options in the <cite>with</cite> statement context.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="data-manipulations-and-sql">
<h2>Data manipulations and SQL<a class="headerlink" href="#data-manipulations-and-sql" title="Permalink to this headline"></a></h2>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.melt.html#pyspark.pandas.melt" title="pyspark.pandas.melt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">melt</span></code></a>(frame[, id_vars, value_vars, var_name, …])</p></td>
<td><p>Unpivot a DataFrame from wide format to long format, optionally leaving identifier variables set.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.merge.html#pyspark.pandas.merge" title="pyspark.pandas.merge"><code class="xref py py-obj docutils literal notranslate"><span class="pre">merge</span></code></a>(obj, right[, how, on, left_on, …])</p></td>
<td><p>Merge DataFrame objects with a database-style join.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.merge_asof.html#pyspark.pandas.merge_asof" title="pyspark.pandas.merge_asof"><code class="xref py py-obj docutils literal notranslate"><span class="pre">merge_asof</span></code></a>(left, right[, on, left_on, …])</p></td>
<td><p>Perform an asof merge.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.get_dummies.html#pyspark.pandas.get_dummies" title="pyspark.pandas.get_dummies"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_dummies</span></code></a>(data[, prefix, prefix_sep, …])</p></td>
<td><p>Convert categorical variable into dummy/indicator variables, also known as one hot encoding.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.concat.html#pyspark.pandas.concat" title="pyspark.pandas.concat"><code class="xref py py-obj docutils literal notranslate"><span class="pre">concat</span></code></a>(objs[, axis, join, ignore_index, sort])</p></td>
<td><p>Concatenate pandas-on-Spark objects along a particular axis with optional set logic along the other axes.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.sql.html#pyspark.pandas.sql" title="pyspark.pandas.sql"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sql</span></code></a>(query[, index_col])</p></td>
<td><p>Execute a SQL query and return the result as a pandas-on-Spark DataFrame.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.broadcast.html#pyspark.pandas.broadcast" title="pyspark.pandas.broadcast"><code class="xref py py-obj docutils literal notranslate"><span class="pre">broadcast</span></code></a>(obj)</p></td>
<td><p>Marks a DataFrame as small enough for use in broadcast joins.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="top-level-missing-data">
<h2>Top-level missing data<a class="headerlink" href="#top-level-missing-data" title="Permalink to this headline"></a></h2>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.isna.html#pyspark.pandas.isna" title="pyspark.pandas.isna"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isna</span></code></a>(obj)</p></td>
<td><p>Detect missing values for an array-like object.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.isnull.html#pyspark.pandas.isnull" title="pyspark.pandas.isnull"><code class="xref py py-obj docutils literal notranslate"><span class="pre">isnull</span></code></a>(obj)</p></td>
<td><p>Detect missing values for an array-like object.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.notna.html#pyspark.pandas.notna" title="pyspark.pandas.notna"><code class="xref py py-obj docutils literal notranslate"><span class="pre">notna</span></code></a>(obj)</p></td>
<td><p>Detect existing (non-missing) values.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.notnull.html#pyspark.pandas.notnull" title="pyspark.pandas.notnull"><code class="xref py py-obj docutils literal notranslate"><span class="pre">notnull</span></code></a>(obj)</p></td>
<td><p>Detect existing (non-missing) values.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="top-level-dealing-with-numeric-data">
<h2>Top-level dealing with numeric data<a class="headerlink" href="#top-level-dealing-with-numeric-data" title="Permalink to this headline"></a></h2>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.to_numeric.html#pyspark.pandas.to_numeric" title="pyspark.pandas.to_numeric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_numeric</span></code></a>(arg[, errors])</p></td>
<td><p>Convert argument to a numeric type.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="top-level-dealing-with-datetimelike-data">
<h2>Top-level dealing with datetimelike data<a class="headerlink" href="#top-level-dealing-with-datetimelike-data" title="Permalink to this headline"></a></h2>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.to_datetime.html#pyspark.pandas.to_datetime" title="pyspark.pandas.to_datetime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_datetime</span></code></a>(arg[, errors, format, unit, …])</p></td>
<td><p>Convert argument to datetime.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.date_range.html#pyspark.pandas.date_range" title="pyspark.pandas.date_range"><code class="xref py py-obj docutils literal notranslate"><span class="pre">date_range</span></code></a>([start, end, periods, freq, tz, …])</p></td>
<td><p>Return a fixed frequency DatetimeIndex.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="api/pyspark.pandas.to_timedelta.html#pyspark.pandas.to_timedelta" title="pyspark.pandas.to_timedelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_timedelta</span></code></a>(arg[, unit, errors])</p></td>
<td><p>Convert argument to timedelta.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="api/pyspark.pandas.timedelta_range.html#pyspark.pandas.timedelta_range" title="pyspark.pandas.timedelta_range"><code class="xref py py-obj docutils literal notranslate"><span class="pre">timedelta_range</span></code></a>([start, end, periods, freq, …])</p></td>
<td><p>Return a fixed frequency TimedeltaIndex, with day as the default frequency.</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class='prev-next-bottom'>
<a class='left-prev' id="prev-link" href="api/pyspark.pandas.read_sql.html" title="previous page">pyspark.pandas.read_sql</a>
<a class='right-next' id="next-link" href="api/pyspark.pandas.reset_option.html" title="next page">pyspark.pandas.reset_option</a>
</div>
</main>
</div>
</div>
<script src="../../_static/js/index.3da636dd464baa7582d2.js"></script>
<footer class="footer mt-5 mt-md-0">
<div class="container">
<p>
&copy; Copyright .<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.0.4.<br/>
</p>
</div>
</footer>
</body>
</html>