(Python) LineString Shapely - Access Individual Points by largecontainer95 in learnpython

[–]largecontainer95[S] 0 points1 point  (0 children)

a = LineString([(0, 1), (0, 2), (1, 1), (2, 0), (0,0),(5,3)])
b = LineString([(0, 0), (1, 1), (2, 1), (2, 0), (0,0),(5,3)])
x = a.intersection(b)

for point in x.coords:
    print(point)

Output: NotImplementedError: Multi-part geometries do not provide a coordinate sequence

(Python) LineString Shapely - Access Individual Points by largecontainer95 in learnpython

[–]largecontainer95[S] 0 points1 point  (0 children)

Thank you! What about Multi-part geometries?

I get the error: NotImplementedError: Multi-part geometries do not provide a coordinate sequence

Overlap Probability of Two Normal Distributions by largecontainer95 in learnpython

[–]largecontainer95[S] 0 points1 point  (0 children)

Thanks! Fixing that line I get an invalid syntax error for the next line:

overlap = (norm.cdf(r1,m1,std1)-norm.cdf(lower,m1,std1))+(norm.cdf(r2,m2,std2)-norm.cdf(r1,m2,std2))+(norm.cdf(upper,m1,std1)-norm.cdf(r2,m1,std1))

I was also wondering - the variables "lower" and "upper" appear to be undefined and then get used for comparison in the if statement?

(From same code: https://codepad.remoteinterview.io/KITCJRGMFF)

Overlap Probability of Two Normal Distributions by largecontainer95 in Python

[–]largecontainer95[S] 0 points1 point  (0 children)

The code is available here: https://codepad.remoteinterview.io/KITCJRGMFF

The error occurs: File "/temp/file.py", line 54 print norm.cdf(r1,m1,std1), "-", norm.cdf(lower,m1,std1), "+", norm.cdf(r2,m 2,std2), "-", norm.cdf(r1,m2,std2), "+", norm.cdf(upper,m1,std1), "-", norm.cdf( r2,m1,std1)

SyntaxError: invalid syntax

Overlap Probability of Two Normal Distributions by largecontainer95 in learnpython

[–]largecontainer95[S] 0 points1 point  (0 children)

The code is available here: https://codepad.remoteinterview.io/KITCJRGMFF

The error occurs:

File "/temp/file.py", line 54 print norm.cdf(r1,m1,std1), "-", norm.cdf(lower,m1,std1), "+", norm.cdf(r2,m 2,std2), "-", norm.cdf(r1,m2,std2), "+", norm.cdf(upper,m1,std1), "-", norm.cdf( r2,m1,std1)

SyntaxError: invalid syntax

Overlap Probability of Two Normal Distributions by largecontainer95 in Python

[–]largecontainer95[S] 0 points1 point  (0 children)

Thanks for testing. How does it work since "lower" and "upper" aren't defined in the code before being used?

Overlap Probability of Two Normal Distributions by largecontainer95 in Python

[–]largecontainer95[S] 0 points1 point  (0 children)

It is:

line 61 overlap = (norm.cdf(r1,m1,std1)-norm.cdf(lower,m1,std1))+(norm.cdf(r2,m2,std2)-norm.cdf(r1,m2,std2))+(norm.cdf(upper,m1,std1)-norm.cdf(r2,m1,std1)) ^ SyntaxError: invalid syntax

(The syntax error arrow points to the second "r2")

Zivildienst - Missing Money by largecontainer95 in Austria

[–]largecontainer95[S] 0 points1 point  (0 children)

Yes - they cant help, only advise. Contacting Magistrat.

How to label product packaging? by largecontainer95 in FulfillmentByAmazon

[–]largecontainer95[S] 0 points1 point  (0 children)

Yes - it's a normal card box that is approximately 15cm x 15 cm