if len(sys.argv) < 3:
sys.stdout.write ("2\nNo of Toss\t10\nSystem Probability\t0.8\n")
sys.exit(0)
in_parameters = map (float, sys.argv[1:-2])
in_rownumber = int(sys.argv[-2])
out_filename = sys.argv[-1]
tmp_filename = out_filename + "_"
tmp_file = open(tmp_filename, 'w+b')
tmp_csv = csv.writer (tmp_file, delimiter=',', quotechar='"')
NToss = int(in_parameters[0])
PSys = int(in_parameters[1])
def Toss():
Draw = np.random.binomial(1, PSys, 1)
tmp_csv.writerow([str(Toss)])
tmp_csv.writerow(["Toss"])
for t in range(1,Toss+1):
Spin()
dimanche 21 août 2016
Inputing 2 values through sys.argv: 1st to determin loop run for coin toss, second to determine the probability for binomial distribution
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire