Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A big for in for Loop!
#1
Hello guys
good day
I have a list of near 10000 points with x,y,z coordinates and a fourth property which is 1 or 2 or 3 (let call it p).
The points are mostly in pair, I mean for almost 95% of points, there is another point with same x,y,z and p.
I need to find out for a point if there is any other point with same x,y,z,p or not!

I have tried a for in for loop in python , something like:
for i=1 to 10000
for j=1 to 10000
if x(i)=x(j) and y(i)=y(j) and z(i)=z(j) and p(i)=p(j)
then put a comment

the code is working well if i have small number of points. for example for a number of point of 500 it takes 10 minutes for python to run.
The problem is that when i put n=10000, it takes a lot of time (near 4 hours)and my computer falls down without any answer.

Would you kindly please show me a solution?
Thanks in advance
Reply


Messages In This Thread
A big for in for Loop! - by faryad13 - Sep-03-2020, 05:58 AM
RE: A big for in for Loop! - by buran - Sep-03-2020, 06:10 AM
RE: A big for in for Loop! - by faryad13 - Sep-03-2020, 06:13 AM
RE: A big for in for Loop! - by buran - Sep-03-2020, 06:20 AM
RE: A big for in for Loop! - by bowlofred - Sep-03-2020, 06:30 AM
RE: A big for in for Loop! - by faryad13 - Sep-03-2020, 08:09 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020