A tool package based on DolphinDB Python API.
Project description
dolphindb-tools
DolphinDB Python Tool Collection
How to Install
pip install dolphindb-tools
For installing dolphindb-tools with support for PyTorch, use the following command:
pip install dolphindb-tools[pytorch]
For installing dolphindb-tools with support for tensorflow, use the following command:
pip install dolphindb-tools[tensorflow]
Example
import dolphindb as ddb
from dolphindb_tools.dataloader import DDBDataLoader
sess = ddb.session()
sess.connect("localhost", 8848, "admin", "123456")
sess.run("""
t = table(1..10 as a, 2..11 as b, 3..12 as c)
""")
sql = 'select * from objByName("t")'
dataloader = DDBDataLoader(sess, sql, ["c"])
for X, y in dataloader:
print(X, y)
--------------------------------------------------
tensor([[1, 2, 3]], dtype=torch.int32) tensor([[3]], dtype=torch.int32)
tensor([[2, 3, 4]], dtype=torch.int32) tensor([[4]], dtype=torch.int32)
tensor([[3, 4, 5]], dtype=torch.int32) tensor([[5]], dtype=torch.int32)
tensor([[4, 5, 6]], dtype=torch.int32) tensor([[6]], dtype=torch.int32)
tensor([[5, 6, 7]], dtype=torch.int32) tensor([[7]], dtype=torch.int32)
tensor([[6, 7, 8]], dtype=torch.int32) tensor([[8]], dtype=torch.int32)
tensor([[7, 8, 9]], dtype=torch.int32) tensor([[9]], dtype=torch.int32)
tensor([[ 8, 9, 10]], dtype=torch.int32) tensor([[10]], dtype=torch.int32)
tensor([[ 9, 10, 11]], dtype=torch.int32) tensor([[11]], dtype=torch.int32)
tensor([[10, 11, 12]], dtype=torch.int32) tensor([[12]], dtype=torch.int32)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file dolphindb_tools-0.2a1-py3-none-any.whl
.
File metadata
- Download URL: dolphindb_tools-0.2a1-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3eb1e2b67c0f16e060c2dd9df200ae5a389ca57412ff4e1b052d7ca68f0b6641 |
|
MD5 | b16e247c26e4e2f48d6cc6fe906499ad |
|
BLAKE2b-256 | ab8c5a963e84c08e00624cf296348b73bb7554352c7be29368d823529c5419d7 |