python - Dataset that holds a list of pre-defined classes for each observation - in R -
i'm new r , need keep dataset contains each observation (let's - user) list of classes (let's events). example - each user_id hold list of events, every event class contains fields: name, time, type.
my question - optimal way hold such data in r? have several millions of such observations need hold in optimal manner (in terms of space).
in addition, after decide how hold it, need create within python, original data in python dict. best way it?
thanks!
you can save dict .csv using csv module python.
mydict = {"a":1, "b":2, "c":3} open("test.csv", "wb") myfile: w = csv.writer(myfile) w.writerows(mydict.items()) then load r read.csv.
of course, depending on python dict looks like, may need more post processing, without reproducible example it's hard be.
Comments
Post a Comment