Tree is a library for working with nested data structures.
Project description
Tree
tree
is a library for working with nested data structures. In a way, tree
generalizes the builtin map
function which only supports flat sequences,
and allows to apply a function to each "leaf" preserving the overall
structure.
>>> import tree
>>> structure = [[1], [[[2, 3]]], [4]]
>>> tree.flatten(structure)
[1, 2, 3, 4]
>>> tree.map_structure(lambda v: v**2, structure)
[[1], [[[4, 9]]], [16]]
tree
is backed by an optimized C++ implementation suitable for use in
demanding applications, such as machine learning models.
Installation
Install tree
by running:
$ pip install dm-tree
Support
If you are having issues, please let us know by filing an issue on our issue tracker.
License
The project is licensed under the Apache 2.0 license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dm-tree-0.1.2.tar.gz
(31.5 kB
view hashes)
Built Distributions
Close
Hashes for dm_tree-0.1.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e901438a2ed2831cae120120da8eb623cc61b2dfa22b22b3e5e7dba36275eb1 |
|
MD5 | 54b354703465bd35989c940d8ab026f7 |
|
BLAKE2b-256 | bd44e1ecb84ae655f15815b1cc5077762081d4406d982bccfaee7fcb5fd649e3 |
Close
Hashes for dm_tree-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bddc7379f38a2ebf7895217599a9e7409d8953581f9aedc3092f83ae344f9fc |
|
MD5 | 73e3c8ede206124243816719d3dfc657 |
|
BLAKE2b-256 | 104b565773de5faeae2e3058a034a708eb6ebbbb22d7e6104e382f204179dac5 |
Close
Hashes for dm_tree-0.1.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1f0cc82981b0e241e9b76d0ff5938ceaa3fc27e8d4a8a0fd55138cc13e77d14 |
|
MD5 | 564ef2feb301d7d9f088bcddc4bf5199 |
|
BLAKE2b-256 | b83158b146b0bf722b4fa623a37faf8662d0c2ddf194861b5fec6935d48c3965 |
Close
Hashes for dm_tree-0.1.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2145e27cc964205e8ba428103c6bb0fca3c47fbca020b20a07ad3e479aca4b90 |
|
MD5 | 6ff97c5877eaf535dde7576e28c7d6dd |
|
BLAKE2b-256 | 2f1ca5384062d1ad166e0ee10138243bf6b6f21d1571973059e044a2d0c8d01d |
Close
Hashes for dm_tree-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8640801c2f885a31e3acbbaf18409834922ef18978227829407ba5c8db865def |
|
MD5 | a71944c2e7a80a394205ed2753b689ca |
|
BLAKE2b-256 | b909d2fb712fb41123cbcf1a513ae6f958259087029050b0a0d64c7b4f02a878 |
Close
Hashes for dm_tree-0.1.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 577cb4be57002d22ab80de761b42da7c2c2ce850d733edb799054c860f39d984 |
|
MD5 | 93969473700b3b971fa46e7739c4efc4 |
|
BLAKE2b-256 | 1e7a6e6d31b8265524c81460a7e625cf262bd6df034883be3b42003c470a9a82 |
Close
Hashes for dm_tree-0.1.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e027d58cc483efc0380aa3d5800d544c75672e87b851a31e989a97eac7d1f4a |
|
MD5 | 8cbfd0ecaa0fd2b2e1d133b9b472799e |
|
BLAKE2b-256 | 427c4cf1b99cd7a60c026f34e2ca4bf785f965c7b8ee43bd6323a6f0d092f41e |
Close
Hashes for dm_tree-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1775af3fd2a6e65e2bb76a1fb9fa594437db792d6e90e886dceee64157e92eaf |
|
MD5 | a55e10dab725637417968322a78f17cc |
|
BLAKE2b-256 | 9488c86c9f426f5624ada4e8ef3365c63769afe14d04ad2f3ff121de90b6f6d4 |
Close
Hashes for dm_tree-0.1.2-cp35-cp35m-macosx_10_9_intel.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b3755366aecae6b81239154ffa6d286e9c36629e7ad0577d656353b3c431dd8 |
|
MD5 | 6db198e363195ed4eb93648488661c27 |
|
BLAKE2b-256 | a1b729c12527ba1b851024a926c05febc7c13cbb320c89b090dce4796599334b |
Close
Hashes for dm_tree-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6267ae4f866cf11a7477de4f70e059c6663a6703c33887e0b10d983805e5bc75 |
|
MD5 | ab802c9fe37327b6693584330c290318 |
|
BLAKE2b-256 | 9d3d3d400ba7753eea6c2a0d902e220f995c8aba0051184e45b3bc395167ec67 |
Close
Hashes for dm_tree-0.1.2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ba4126bdc14cb130c1da52802fc03aadf082d9b9a46aec3e3d0c374c3d1b626 |
|
MD5 | bd04accb36d7c8cd711e2328948ab86f |
|
BLAKE2b-256 | b6a62aee606c232522f71768d5d5b1f81838dd30276e79fd5d46ec4a7780599d |
Close
Hashes for dm_tree-0.1.2-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1406ff426be4d4e6a3818dc07487dd7cfde0662f31c464ef71c7875663693489 |
|
MD5 | 435af075cec6670fad34c644cf2499b2 |
|
BLAKE2b-256 | 7954ecfc065f27821a422dbef376a2f0f57bf46d69465d2a4af5ea4b6e0f815a |