December 17th, 2012, 11:33 AM
Join Date: Dec 2012
Time spent in forums: 18 m 49 sec
Reputation Power: 0
Read Data From File And Analyse
I have a text file that has data like the following:
The first column is the date, second is a user ID. I want to load this text file into Python and analyse it. What is the best way to store it? An array or table/list?
Sort of analysis I'd do is what user ID was date stamped 5 days ago.
This is where I am right now:
f = open('data.txt','r+')
data_list = f.readlines()
When I print data_list, I get the data, but it also has the MS-DOS /n new line character too. Ideally, I'd want to store the date along with the user ID in an array where I can query them.