yabs.io

Yet Another Bookmarks Service

Viewing time's Bookmarks

scripting delete ,

[http://bodybugglinux.blogspot.com/2009/07/trivial-activity-classifier-that-works.html] - - public:time
bodybugg, hacking, scripting - 3 | id:3574 -

The Nitty Gritty: from rpy import * import csv import sys import string from PIL import Image import numpy f=open("tmp/z709a-full-serial-24hr.csv","r") lns = f.readlines() f.close() rdr = csv.reader(lns, delimiter='\t') rx = [x for x in rdr] recs=[[int(y) for y in x[2:-1]] for x in rx if x[0][:3] == '124'] nil=[sys.stdout.write(rx[i][1] + " " + str(foo[i])+"\n") for i in range(0, len(foo))] mrecs=matrix(recs) cl = r.kmeans(mrecs, 3) foo=[[cl['cluster'][i]] + [z for z in mrecs[i].tolist()[0]] for i in range(0, len(mrecs))] cmap=[255, 0, 128] cline=[[cmap[x[0]-1]]*50 for x in foo] cm=numpy.array(cline,dtype='uint8') # Display image Image.fromarray(cm).show()

With marked bookmarks
| (+) | |

Viewing 1 - 7, 7 links out of 7 links, page: 1

Follow Tags

Manage

Export:

JSONXMLRSS