|
55 | 55 |
|
56 | 56 | <body> |
57 | 57 | <header> |
58 | | - <aside>December 5, 2024</aside> |
| 58 | + <aside>December 6, 2024</aside> |
59 | 59 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
60 | 60 | </header> |
61 | 61 |
|
@@ -2580,8 +2580,8 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2580 | 2580 | </code></pre></div> |
2581 | 2581 |
|
2582 | 2582 |
|
2583 | | -<pre><code class="python language-python hljs"><S> = pd.Series(<list>) <span class="hljs-comment"># Creates index from list's indices.</span> |
2584 | | -<S> = pd.Series(<dict>) <span class="hljs-comment"># Creates index from dictionary's keys.</span> |
| 2583 | +<pre><code class="python language-python hljs"><S> = pd.Series(<list>) <span class="hljs-comment"># Uses list's indices for 'index'.</span> |
| 2584 | +<S> = pd.Series(<dict>) <span class="hljs-comment"># Uses dictionary's keys for 'index'.</span> |
2585 | 2585 | </code></pre> |
2586 | 2586 | <pre><code class="python language-python hljs"><el> = <S>.loc[key] <span class="hljs-comment"># Or: <S>.iloc[i]</span> |
2587 | 2587 | <S> = <S>.loc[coll_of_keys] <span class="hljs-comment"># Or: <S>.iloc[coll_of_i]</span> |
@@ -2741,7 +2741,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2741 | 2741 | <DF>.to_sql(<span class="hljs-string">'<table_name>'</span>, <connection>) <span class="hljs-comment"># Also `if_exists='fail/replace/append'`.</span> |
2742 | 2742 | </code></pre> |
2743 | 2743 | <ul> |
2744 | | -<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 'datefirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.</strong></li> |
| 2744 | +<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 'datefirst' arguments. Both dates and datetimes get stored as pd.Timestamp objects.</strong></li> |
2745 | 2745 | <li><strong>If there's a single invalid date then it returns the whole column as a series of strings, unlike <code class="python hljs"><span class="hljs-string">'<S> = pd.to_datetime(<S>, errors="coerce")'</span></code>, which uses pd.NaT.</strong></li> |
2746 | 2746 | <li><strong>To get specific attributes from a series of Timestamps use <code class="python hljs"><span class="hljs-string">'<S>.dt.year/date/…'</span></code>.</strong></li> |
2747 | 2747 | </ul> |
@@ -2924,7 +2924,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2924 | 2924 |
|
2925 | 2925 |
|
2926 | 2926 | <footer> |
2927 | | - <aside>December 5, 2024</aside> |
| 2927 | + <aside>December 6, 2024</aside> |
2928 | 2928 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
2929 | 2929 | </footer> |
2930 | 2930 |
|
|
0 commit comments