<li><strong><codeclass="python hljs"><spanclass="hljs-string">'%Z'</span></code> accepts <codeclass="python hljs"><spanclass="hljs-string">'UTC/GMT'</span></code> and local timezone's code and returns timezone's name, <codeclass="python hljs"><spanclass="hljs-string">'UTC[±HH:MM]'</span></code> if timezone is nameless, or an empty string if datetime is naive.</strong></li>
</ul>
<div><h3id="arithmetics">Arithmetics</h3><pre><codeclass="python language-python apache hljs"><bool> = <D/T/DTn>><D/T/DTn><spanclass="hljs-comment"># Ignores time jumps (fold attribute). Also ==.</span>
<bool> = <DTa>><DTa><spanclass="hljs-comment"># Ignores jumps if they share tz object. Broken ==.</span>
<bool> = <DTa>><DTa><spanclass="hljs-comment"># Ignores time jumps if they share tzinfo object.</span>
<TD> = <D/DTn> - <D/DTn><spanclass="hljs-comment"># Ignores jumps. Convert to UTC for actual delta.</span>
<TD> = <DTa> - <DTa><spanclass="hljs-comment"># Ignores jumps if they share tzinfo object.</span>
<D/DT> = <D/DT> ± <TD><spanclass="hljs-comment"># Returned datetime can fall into missing hour.</span>
<pre><codeclass="python language-python hljs"><S> = <S>><el/S><spanclass="hljs-comment"># Returns S of bools. Pairs items by keys.</span>
<pre><codeclass="python language-python hljs"><S> = <S>><el/S><spanclass="hljs-comment"># Returns S of bools. For logic use &, |, ~.</span>
<S> = <S> + <el/S><spanclass="hljs-comment"># Items with non-matching keys get value NaN.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><S> = pd.concat(<coll_of_S>) <spanclass="hljs-comment"># Concats multiple series into one long Series.</span>
<S> = <S>.combine_first(<S>) <spanclass="hljs-comment"># Adds items that are not yet present.</span>
<S>.update(<S>) <spanclass="hljs-comment"># Updates items that are already present.</span>
<pre><codeclass="python language-python hljs"><S> = <S>.value_counts(normalize=<spanclass="hljs-keyword">False</span>) <spanclass="hljs-comment"># Returns S of unique values and their counts.</span>
<S> = <S>.str.strip/lower/contains/replace() <spanclass="hljs-comment"># Processes strings. For dates see File Formats.</span>
</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>
</code></pre>
@ -2605,7 +2605,7 @@ Name: a, dtype: int64
<li><strong>Pandas uses NumPy types like <codeclass="python hljs"><spanclass="hljs-string">'np.int64'</span></code>. Series is converted to <codeclass="python hljs"><spanclass="hljs-string">'float64'</span></code> if we assign np.nan to any item. Use <codeclass="python hljs"><spanclass="hljs-string">'<S>.astype(<str/type>)'</span></code> to get converted Series.</strong></li>
<li><strong>Series will silently overflow if we run <codeclass="python hljs"><spanclass="hljs-string">'pd.Series([100], dtype="int8") + 100'</span></code>!</strong></li>