Developer
def Lover(Programming):
return ['Love']*len(Programming)
print Lover(['Python','Fortran','VB','Matlab',[]])
|
23h
|
|
comment |
What are efficient algorithms to join segments and to split a line into segments? @ThomasG77 Yeah, they are of course tools doing this perfectly. We prefer however to implement ourselves as so we are looking for some efficient algorithms rather than packages/software. We do it now as we explained to Kirk Kuykendall using dict in Python. It does job but there is efficiency issue as we will apply it on millions of lines.
|
|
1d
|
|
revised |
Python: How to get argument's name runtime added 4 characters in body |
|
1d
|
|
comment |
getting Python variable name in runtime See this link as another solution. |
|
1d
|
|
comment |
getting Python variable name in runtime You can surely, as seen in here. |
|
1d
|
|
accepted | Python: How to get argument's name runtime |
|
1d
|
|
comment |
Python: How to get argument's name runtime Great! it prints: ['printname(a)\n'] which can be easily used not only for extraction of the name of the argument (a) but also the function's name.
|
|
1d
|
|
comment |
Python: How to get argument's name runtime As you see in the tiny link in the post blue(?) we noticed it may not be possible. However, we still are hopeful for some trick to make our function to work. Think this way. Any idea? |
|
1d
|
|
asked | Python: How to get argument's name runtime |
|
2d
|
|
comment |
What are efficient algorithms to join segments and to split a line into segments? We are not sure about that either. In our previous attempts for another issue we noticed however Shapely was 10 times slower than our mixed Python-Fortran implementation.
|
|
2d
|
|
comment |
What are efficient algorithms to join segments and to split a line into segments? Indeed, we have already implemented a similar idea in Python using defaultdict. This is not efficient as you need to update the dictionary entirely after joining every two segments.
|
|
2d
|
|
comment |
What are efficient algorithms to join segments and to split a line into segments? Please note that we don't know which point belongs to which line. Line segments are not listed in any order. They are randomly located in an array. If you know which line is aligned (next) to a line, joining them is not an issue. But notice that we don't have any topology information of lines. No information between points and lines. |
|
May
22 |
|
comment |
What are efficient algorithms to join segments and to split a line into segments? @DevdattaTengshe Right, even after splitting the will have points in common. The gaps above (part left) are only for demonstration. We don't have a record of belonging points to a specific line. Indeed, the inputs are segments (or lines for question 2) and points. We drew them here together for demonstration. |
|
May
22 |
|
comment |
What are efficient algorithms to join segments and to split a line into segments? @PolyGeo None. We will code in Python. The points above are intersection points with many other lines that are removed later. So our interest is to split each line to many segments based on the intersecting points (part left). Our another interest is reversing the act, that is having a series of aligned (parallel) segments to join them as one line if possible (part right).
|
|
May
22 |
|
asked | What are efficient algorithms to join segments and to split a line into segments? |
|
May
18 |
|
comment |
inner convex-hulls in a set of 2D points Thanks, finally we could understand your point. We added a demonstration of the problem too. |
|
May
18 |
|
revised |
inner convex-hulls in a set of 2D points added 358 characters in body |
|
May
18 |
|
comment |
inner convex-hulls in a set of 2D points @whuber We added a complete solution that we are looking for as update 2. |
|
May
18 |
|
revised |
inner convex-hulls in a set of 2D points added 771 characters in body |
|
May
17 |
|
awarded | Enthusiast |
|
May
17 |
|
comment |
inner convex-hulls in a set of 2D points @whuber & UffeKousgaard: The correct solution for your data is a rectangle (white) in the middle plus two triangles 3 and 4. These are largest ICHs (with no overlapping) and cover the area fully. |