Skip to content

Instantly share code, notes, and snippets.

@yashgyy
Created December 1, 2018 20:09
Show Gist options
  • Save yashgyy/90fa1cdf19808c6a331ceac4a01e027a to your computer and use it in GitHub Desktop.
Save yashgyy/90fa1cdf19808c6a331ceac4a01e027a to your computer and use it in GitHub Desktop.
from itertools import combinations
Mutate=[]
for Value1,Value2 in list(combinations(Listing),r=2):
nums=numpy.random.choice([0,1],size=34)
Tupple=[Value1[i] if nums[i]==0 else Value2[i] for i in range(len(nums))]
Mutate.append(Tupple)
Listing2=[]
for j in Mutate:
for key,value in j.items():
Listing2.append((community.best_partition(key),community.modularity(communities1,key)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment