Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9b1e3e1

Browse filesBrowse files
authored
Usage Examples
1 parent b7c4293 commit 9b1e3e1
Copy full SHA for 9b1e3e1

File tree

Expand file treeCollapse file tree

1 file changed

+13
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-4
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+13-4Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,23 @@ Anecdotally, we use this to load approximately 640 million rows of data from a 7
2323

2424
```python3
2525

26-
from pandas_to_postgres import ...
26+
from pandas_to_postgres import (
27+
DataFrameCopy,
28+
hdf_to_postgres,
29+
multiprocess_hdf_to_postgres,
30+
)
2731

28-
# already loaded dataframe
29-
...
32+
table_model = db.metadata.tables['my_awesome_table']
33+
34+
# already loaded DataFrame & SQLAlchemy Table model
35+
with db.engine.connect() as c:
36+
DataFrameCopy(df, conn=c, table_obj=table_model).copy()
3037

3138
# HDF from file
32-
...
39+
hdf_to_postgres('./data.h5', db)
3340

41+
# Parallel HDF from file
42+
multiprocess_hdf_to_postgres('./data.h5', db, processes=4)
3443
```
3544

3645
# Other Comparisons

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.