<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Pandas_sql</id>
	<title>Pandas sql - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=Pandas_sql"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Pandas_sql&amp;action=history"/>
	<updated>2026-04-25T17:17:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=Pandas_sql&amp;diff=4520&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;# Prep for sqlite3 ``` import pandas as pd import sqlite3 def write_sql_from_dfs():   for table, df in dfs.items():  # loop through `dict` of dataframes     uuids = []     for...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=Pandas_sql&amp;diff=4520&amp;oldid=prev"/>
		<updated>2023-09-07T23:47:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;# Prep for sqlite3 ``` import pandas as pd import sqlite3 def write_sql_from_dfs():   for table, df in dfs.items():  # loop through `dict` of dataframes     uuids = []     for...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;# Prep for sqlite3&lt;br /&gt;
```&lt;br /&gt;
import pandas as pd&lt;br /&gt;
import sqlite3&lt;br /&gt;
def write_sql_from_dfs():&lt;br /&gt;
  for table, df in dfs.items():  # loop through `dict` of dataframes&lt;br /&gt;
    uuids = []&lt;br /&gt;
    for i in range(len(df.index)):&lt;br /&gt;
      uuids.append(uuid.uuid4())&lt;br /&gt;
    df.insert(0, &amp;quot;uuid&amp;quot;, uuids)&lt;br /&gt;
    df['timestamp'] = pd.Timestamp(&amp;quot;now&amp;quot;)&lt;br /&gt;
    # df['timestamp'] = [pd.Timestamp(&amp;quot;now&amp;quot;) for _ in range(len(df.index))]&lt;br /&gt;
    for i in df.columns:&lt;br /&gt;
      for i in df.columns:  df[i] =  df[i].astype(&amp;quot;string&amp;quot;)&lt;br /&gt;
    df.to_sql(name=table, con=cnx, if_exists='append', index=False)&lt;br /&gt;
&lt;br /&gt;
def main():&lt;br /&gt;
  global cnx&lt;br /&gt;
  cnx = sqlite3.connect(f&amp;quot;mydb.sqlite3&amp;quot;)&lt;br /&gt;
  write_sql_from_dfs()&lt;br /&gt;
&lt;br /&gt;
if __name__ == &amp;quot;__main__&amp;quot;:&lt;br /&gt;
  main()&lt;br /&gt;
```&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>