|
56 | 56 |
|
57 | 57 | <body> |
58 | 58 | <header> |
59 | | - <aside>March 3, 2025</aside> |
| 59 | + <aside>March 8, 2025</aside> |
60 | 60 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
61 | 61 | </header> |
62 | 62 |
|
@@ -2753,8 +2753,9 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2753 | 2753 | </code></pre> |
2754 | 2754 | <ul> |
2755 | 2755 | <li><strong><code class="python hljs"><span class="hljs-string">'$ pip3 install "pandas[excel]" odfpy lxml pyarrow'</span></code> installs dependencies.</strong></li> |
2756 | | -<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> |
2757 | | -<li><strong>If 'parse_dates' and 'index_col' are the same column, we get a DF with DatetimeIndex. Its <code class="python hljs"><span class="hljs-string">'resample("y/m/d/h")'</span></code> method returns a Resampler object that is similar to GroupBy.</strong></li> |
| 2756 | +<li><strong>Csv functions use the same dialect as standard library's csv module (e.g. <code class="python hljs"><span class="hljs-string">'sep=","'</span></code>).</strong></li> |
| 2757 | +<li><strong>Read_csv() only parses dates of columns that are listed in 'parse_dates'. It automatically tries to detect the format, but it can be helped with 'date_format' or 'dayfirst' arguments.</strong></li> |
| 2758 | +<li><strong>We get a dataframe with DatetimeIndex if 'parse_dates' argument includes 'index_col'. Its <code class="python hljs"><span class="hljs-string">'resample("y/m/d/h")'</span></code> method returns Resampler object that is similar to GroupBy.</strong></li> |
2758 | 2759 | </ul> |
2759 | 2760 | <div><h3 id="groupby">GroupBy</h3><p><strong>Object that groups together rows of a dataframe based on the value of the passed column.</strong></p><pre><code class="python language-python hljs"><GB> = <DF>.groupby(col_key/s) <span class="hljs-comment"># Splits DF into groups based on passed column.</span> |
2760 | 2761 | <DF> = <GB>.apply/filter(<func>) <span class="hljs-comment"># Filter drops a group if func returns False.</span> |
@@ -2942,7 +2943,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2942 | 2943 |
|
2943 | 2944 |
|
2944 | 2945 | <footer> |
2945 | | - <aside>March 3, 2025</aside> |
| 2946 | + <aside>March 8, 2025</aside> |
2946 | 2947 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
2947 | 2948 | </footer> |
2948 | 2949 |
|
|
0 commit comments