<DF> = pd.read_csv/pickle/excel(<spanclass="hljs-string">'<path/url>'</span>) <spanclass="hljs-comment"># Use `sheet_name=None` to get all Excel sheets.</span>
<DF> = pd.read_csv/pickle/excel(<spanclass="hljs-string">'<path/url>'</span>) <spanclass="hljs-comment"># Use `sheet_name=None` to get all Excel sheets.</span>
<DF> = pd.read_sql(<spanclass="hljs-string">'<table/query>'</span>, <conn.>) <spanclass="hljs-comment"># Accepts SQLite3 or SQLAlchemy connection.</span>
<DF> = pd.read_sql(<spanclass="hljs-string">'<table/query>'</span>, <conn.>) <spanclass="hljs-comment"># SQLite3/SQLAlchemy connection (see #SQLite).</span>
<DF> = pd.read_clipboard() <spanclass="hljs-comment"># Reads a copied table from the clipboard.</span>
<DF> = pd.read_clipboard() <spanclass="hljs-comment"># Reads a copied table from the clipboard.</span>
</code></pre>
</code></pre>
<pre><codeclass="python language-python hljs"><dict> = <DF>.to_dict([<spanclass="hljs-string">'d/l/s/…'</span>]) <spanclass="hljs-comment"># Returns columns as dicts, lists or series.</span>
<pre><codeclass="python language-python hljs"><dict> = <DF>.to_dict([<spanclass="hljs-string">'d/l/s/…'</span>]) <spanclass="hljs-comment"># Returns columns as dicts, lists or series.</span>
<str> = <DF>.to_json/html/csv([<path>]) <spanclass="hljs-comment"># Also to_markdown/latex([<path>]).</span>
<str> = <DF>.to_json/html/csv([<path>]) <spanclass="hljs-comment"># Also to_markdown/latex([<path>]).</span>
<DF>.to_pickle/excel(<path>) <spanclass="hljs-comment"># Run `$ pip3 install "pandas[excel]" odfpy`.</span>
<DF>.to_pickle/excel(<path>) <spanclass="hljs-comment"># Run `$ pip3 install "pandas[excel]" odfpy`.</span>
<DF>.to_sql(<spanclass="hljs-string">'<table_name>'</span>, <connection>) <spanclass="hljs-comment"># Accepts SQLite3 or SQLAlchemy connection.</span>
<DF>.to_sql(<spanclass="hljs-string">'<table_name>'</span>, <connection>) <spanclass="hljs-comment"># Also `if_exists='fail/replace/append'`.</span>
</code></pre>
</code></pre>
<div><h3id="groupby">GroupBy</h3><p><strong>Object that groups together rows of a dataframe based on the value of the passed column.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>df = pd.DataFrame([[<spanclass="hljs-number">1</span>, <spanclass="hljs-number">2</span>, <spanclass="hljs-number">3</span>], [<spanclass="hljs-number">4</span>, <spanclass="hljs-number">5</span>, <spanclass="hljs-number">6</span>], [<spanclass="hljs-number">7</span>, <spanclass="hljs-number">8</span>, <spanclass="hljs-number">6</span>]], list(<spanclass="hljs-string">'abc'</span>), list(<spanclass="hljs-string">'xyz'</span>))
<div><h3id="groupby">GroupBy</h3><p><strong>Object that groups together rows of a dataframe based on the value of the passed column.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-meta">>>></span>df = pd.DataFrame([[<spanclass="hljs-number">1</span>, <spanclass="hljs-number">2</span>, <spanclass="hljs-number">3</span>], [<spanclass="hljs-number">4</span>, <spanclass="hljs-number">5</span>, <spanclass="hljs-number">6</span>], [<spanclass="hljs-number">7</span>, <spanclass="hljs-number">8</span>, <spanclass="hljs-number">6</span>]], list(<spanclass="hljs-string">'abc'</span>), list(<spanclass="hljs-string">'xyz'</span>))