Skip to content

Commit

Permalink
Python script fixes to make it work with Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Boytsov authored and Leonid Boytsov committed Jul 25, 2018
1 parent 1be8dcb commit 0bb601b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions data/genunif.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
dim = args['dim']

if args['binary'] and args['gauss']:
print "You cannot specify both 'binary' and 'normal'"
print("You cannot specify both 'binary' and 'normal'")
sys.exit(1)

f=open(outf, 'w')
if args['gauss']:
f.write("\n".join(["\t".join([str(random.normalvariate(0,1)) for _ in xrange(dim)]) for _ in xrange(nd+1)]))
f.write("\n".join(["\t".join([str(random.normalvariate(0,1)) for _ in range(dim)]) for _ in range(nd+1)]))
elif args['binary'] :
f.write("\n".join(["\t".join([str(random.randint(0,1)) for _ in xrange(dim)]) for _ in xrange(nd+1)]))
f.write("\n".join(["\t".join([str(random.randint(0,1)) for _ in range(dim)]) for _ in range(nd+1)]))
else:
f.write("\n".join(["\t".join([str(random.random()) for _ in xrange(dim)]) for _ in xrange(nd+1)]))
f.write("\n".join(["\t".join([str(random.random()) for _ in range(dim)]) for _ in range(nd+1)]))
f.close()

0 comments on commit 0bb601b

Please sign in to comment.