In [120]:
import csv
import pandas
import matplotlib.pyplot as plt
%matplotlib inline
In [127]:
stuff = []
while True:
add = input("what?")
if add == 'done':
print("end of collection")
print(stuff)
break
add = float(add)
stuff.append(add)
print(stuff)
df1 = pandas.DataFrame(stuff)
df1.to_csv('lets1.csv', sep=',')
new_df = pandas.read_csv('lets1.csv')
new_df
Out[127]:
In [128]:
new_df.plot()
Out[128]:
In [ ]:
##### stuff = []
outfile = open('test2.txt', 'a')
try:
while True:
add = input('add')
# if add == 'done':
# print("end of collection")
# print(stuff)
# break
add = float(add)
outfile.write(str(add) + ",")
except KeyboardInterrupt:
raise
print("done-zo")
# with open('test.txt', "wb") as file:
# writer = csv.writer(file)
# writer.writerow([r.get_value() for r in stuff])
# with open('test.txt', 'wb') as csvfile:
# write = csv.writer(csvfile)
# print(type(stuff))
# # for i in range(len(stuff)):
# write.writerow(stuff)
In [82]:
outfile = open('test2.txt', 'a')
for i in range(len(stuff)):
outfile.write(str(stuff[i]) + ",")
print(i)
In [114]:
new_df
Out[114]:
In [ ]:
In [ ]: