r/learnpython•
Aman1996

ACII data not outputting into python array

So I have to work with some data stored in two zipped files, but it is not outputting a python array that I can use as an analysis on python. The zipped files were put under one directory. This is what I have so far.

import csv
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab                              
file1 = open('run2.dat', 'rb')              
data = csv.reader(file1, delimiter='\t') 
table = [row for row in data]              
plt.title(r'Photoelectrons')
plt.show()

I think the problem is that the data is not unzipped into the 'run2.dat' file, but I'm not sure exactly. Eventually, I will make a histogram from the data, which is why I have matplotlib.

Posted Jun 16, 2017, 7:48 PM UTC

12
Loading comments…