×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

creat a set from a list of vector

creat a set from a list of vector

creat a set from a list of vector

(OP)
Hi,
I have 4 vectors that contains edges, I want to create for each vector a set to apply a section.
The program with which I created the vectors is below:
edges1=[]
edges2=[]
edges3=[]
edges4=[]

for edge in p.edges:
i=edge.index
if i %(36)==0 or i %(36)==1 or i %(36)==34 or i % (36) == 35:
edges1.append(edge)
elif i%36 ==2 or i%36 ==3 or i%36 ==4 or i%36 ==31 or i%36 ==32 or i%36 ==33 :
edges2.append(edge)
elif i%36 ==5 or i%36 ==6 or i%36 ==7 or i%36 ==8 or i%36 ==27 or i%36 ==28 or i%36 ==29 or i%36 ==30:
edges3.append(edge)
else:
edges4.append(edge)
thanks for your help!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources