* **Read\_csv() only parses dates of columns that were specified by 'parse\_dates' argument. It automatically tries to detect the format, but it can be helped with 'date\_format' or 'dayfirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.**
* **Read\_csv() only parses dates of columns that were specified by 'parse\_dates' argument. It automatically tries to detect the format, but it can be helped with 'date\_format' or 'dayfirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.**
* **If there's a single invalid date then it returns the whole column as a series of strings, unlike `'<S> = pd.to_datetime(<S>, errors="coerce")'`, which uses pd.NaT.**
* **If 'parse\_dates' and 'index_col' are the same column, we get a DF with DatetimeIndex. Its `'resample("y/m/d/h")'` method returns a Resampler object that is similar to GroupBy.**
### GroupBy
### GroupBy
**Object that groups together rows of a dataframe based on the value of the passed column.**
**Object that groups together rows of a dataframe based on the value of the passed column.**
<pre><codeclass="python language-python hljs"><S> = <S>.head/describe/sort_values() <spanclass="hljs-comment"># Also <S>.unique/value_counts/round/dropna().</span>
<pre><codeclass="python language-python hljs"><S> = <S>.head/describe/sort_values() <spanclass="hljs-comment"># Also <S>.unique/value_counts/round/dropna().</span>
<S> = <S>.str.strip/lower/contains/replace() <spanclass="hljs-comment"># Also split().str[i] or split(expand=True).</span>
<S> = <S>.str.strip/lower/contains/replace() <spanclass="hljs-comment"># Also split().str[i] or split(expand=True).</span>
<S> = <S>.dt.year/month/day/hour <spanclass="hljs-comment"># Use pd.to_datetime(<S>) to get S of dates.</span>
<S> = <S>.dt.year/month/day/hour <spanclass="hljs-comment"># Use pd.to_datetime(<S>) to get S of datetimes.</span>
<S> = <S>.dt.to_period(<spanclass="hljs-string">'y/m/d/h'</span>) <spanclass="hljs-comment"># Quantizes datetimes into Period objects.</span>
</code></pre>
</code></pre>
<pre><codeclass="python language-python hljs"><S>.plot.line/area/bar/pie/hist() <spanclass="hljs-comment"># Generates a plot. `plt.show()` displays it.</span>
<pre><codeclass="python language-python hljs"><S>.plot.line/area/bar/pie/hist() <spanclass="hljs-comment"># Generates a plot. `plt.show()` displays it.</span>
</code></pre>
</code></pre>
@ -2639,7 +2640,6 @@ Name: a, dtype: int64
</code></pre>
</code></pre>
<ul>
<ul>
<li><strong>Agg() and transform() pass a Series to a function if it raises Type/Val/AttrError on a scalar.</strong></li>
<li><strong>Last result has a multi-index. Use <codeclass="python hljs"><spanclass="hljs-string">'<S>[key_1, key_2]'</span></code> to get its values.</strong></li>
<li><strong>Last result has a multi-index. Use <codeclass="python hljs"><spanclass="hljs-string">'<S>[key_1, key_2]'</span></code> to get its values.</strong></li>
</ul>
</ul>
<div><h3id="dataframe">DataFrame</h3><p><strong>Table with labeled rows and columns.</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>]], index=[<spanclass="hljs-string">'a'</span>, <spanclass="hljs-string">'b'</span>], columns=[<spanclass="hljs-string">'x'</span>, <spanclass="hljs-string">'y'</span>]); df
<div><h3id="dataframe">DataFrame</h3><p><strong>Table with labeled rows and columns.</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>]], index=[<spanclass="hljs-string">'a'</span>, <spanclass="hljs-string">'b'</span>], columns=[<spanclass="hljs-string">'x'</span>, <spanclass="hljs-string">'y'</span>]); df
@ -2754,7 +2754,7 @@ c <span class="hljs-number">6</span> <span class="hljs-number">7</span>
<li><strong>Read_csv() only parses dates of columns that were specified by 'parse_dates' argument. It automatically tries to detect the format, but it can be helped with 'date_format' or 'dayfirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.</strong></li>
<li><strong>Read_csv() only parses dates of columns that were specified by 'parse_dates' argument. It automatically tries to detect the format, but it can be helped with 'date_format' or 'dayfirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.</strong></li>
<li><strong>If there's a single invalid date then it returns the whole column as a series of strings, unlike<codeclass="python hljs"><spanclass="hljs-string">'<S> = pd.to_datetime(<S>, errors="coerce")'</span></code>, which uses pd.NaT.</strong></li>
<li><strong>If 'parse_dates' and 'index_col' are the same column, we get a DF with DatetimeIndex. Its<codeclass="python hljs"><spanclass="hljs-string">'resample("y/m/d/h")'</span></code> method returns a Resampler object that is similar to GroupBy.</strong></li>
</ul>
</ul>
<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"><GB> = <DF>.groupby(col_key/s) <spanclass="hljs-comment"># Splits DF into groups based on passed column.</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"><GB> = <DF>.groupby(col_key/s) <spanclass="hljs-comment"># Splits DF into groups based on passed column.</span>
<DF> = <GB>.apply/filter(<func>) <spanclass="hljs-comment"># Filter drops a group if func returns False.</span>
<DF> = <GB>.apply/filter(<func>) <spanclass="hljs-comment"># Filter drops a group if func returns False.</span>
@ -2942,7 +2942,7 @@ $ deactivate <span class="hljs-comment"># Deactivates the active