<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>
<S/DF> = pd.read_parquet/feather/hdf(<path…>) <spanclass="hljs-comment"># Function read_hdf() accepts `key=<s/df_name>`.</span>
<DF> = pd.read_sql(<spanclass="hljs-string">'<table/query>'</span>, <conn>) <spanclass="hljs-comment"># Pass SQLite3/Alchemy connection (see #SQLite).</span>
</code></pre></div>
<pre><codeclass="python language-python hljs"><DF>.to_json/csv/html/parquet/latex(<path>) <spanclass="hljs-comment"># Returns a string/bytes if path is omitted.</span>
<DF>.to_sql(<spanclass="hljs-string">'<table_name>'</span>, <connection>) <spanclass="hljs-comment"># Also `if_exists='fail/replace/append'`.</span>
</code></pre>
<ul>
@ -2764,7 +2764,7 @@ c <span class="hljs-number">6</span> <span class="hljs-number">7</span>
xxxxxxxxxx