69 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
4
answers
123
views
How can I create a stylized tree chart?
I have been making a tree of fraternity-adjacent bigs and littles and was looking for a way to automate it for changes as more people join. Everyone's names and years, big, and littles are in an Excel ...
1
vote
1
answer
105
views
How to Share a Node with Multiple Parents in anytree?
I am trying to build a tree structure using Python's anytree library. However, I am facing an issue with sharing a node (specifically node 984) among multiple parents. Here is my code:
from anytree ...
0
votes
1
answer
56
views
How do I find a specific Python anytree descendant?
The following Python anytree construction
top = Node("top")
a = Node("a", parent=top)
b = Node("b", parent=top)
c = Node("c", parent=a)
d = Node("d", ...
0
votes
1
answer
48
views
Why is my binary K-dimensional tree not rendered properly?
I'm working with anytree package in Python for creating and displaying a K-dimension tree, however the tree is not rendered properly.
This is part of my source code for my K-dimensional node:
import ...
1
vote
1
answer
282
views
Fast tree Walking in Anytree
I have stumbled upon a problem whilst trying to walk my binary tree constructed using AnyNode from anytree.
First, I need to say that each node has a specific id associated with it, so that the root ...
1
vote
1
answer
82
views
Modify the python script that inserts data from a text file into an excel file
I need a python script that reads some trees from a text file and puts them in an excel file. Go through each tree from the last node to the root and enter the data in a specified excel. The text file ...
0
votes
1
answer
254
views
Python script to extract data from an excel and put it in trees
I have a python script that extracts data from an excel, more precisely, data from three columns: Finished Good, Parent Part Code and Material Code. The three columns look like this:
Material Code ...
1
vote
1
answer
436
views
Simple list of branch for a Node Python AnyTree
Given a simple tree in AnyTree, when I look at a node it tells me its path to the root, but I cannot find anything that will simply give me that path as a list of the node names, or as a string which ...
0
votes
1
answer
183
views
How to build a Python anytree tree based on another tree?
If I have this tree:
# mytree.py
import anytree as at
import anytree.importer
data = {
"a": "root",
"children": [
{
"a": "sub0&...
2
votes
1
answer
2k
views
get tree view from a dictionary with anytree or rich, or treelib
I read the manual from https://anytree.readthedocs.io/en/latest/#, but I didn't figure out how to translate a dictionary to tree view, anyone can help?
data = {
'Marc': 'Udo',
'Lian': 'Marc',
...
0
votes
1
answer
516
views
Renaming Anytree Parent and Child Name
I have a dataset as follows
Unique Name
Parent
Child
US_SQ
A
A1
UC_LC
A
A2
UK_SJ
A2
A21
UI_QQ
B
B1
Now I want to set the output as follows:
US_SQ
├── A1
└── UC_LC
└── UK_SJ
UI_QQ
└── B1
In other ...
0
votes
1
answer
891
views
Copying an AnyTree in Python
I want to take the node of a tree created with AnyTree and copy the whole tree so I can make changes to it without changing the original.
The only thing that I can think of is looping through the ...
1
vote
1
answer
728
views
Construct anytree from pandas DataFrame with multiple parents
I've got a huge DataFrame. This just an example. But you can see that "b" element has "a", "d", "k" parents.
data = pd.DataFrame(columns=["Parent",&...
1
vote
1
answer
251
views
How to convert pycparser ast to python anytree format?
I am trying to convert the ast from pycparser to python anytree for further processing tasks. But the anytree tree I am currently getting does not contain several useful information and I also cannot ...
1
vote
0
answers
183
views
How to count vertices (or edges) using `anytree`?
I would like to determine the size of a tree by number of vertices.
Clearly,
len(list(PreOrderIter(root)))
gives me this number.
Is this the way to do it?
In other words, is there a recommended ...