Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from collections import OrderedDict
- import pandas as pd
- table = OrderedDict(( \
- ("MA", ['11', '22', '33', '11', '22', '33']), \
- ('TY',['IN', 'IN', 'IN', 'OUT', 'OUT', 'OUT']), \
- ('TS', ['00:00:11', '00:00:22', '00:00:33', '00:00:45', '00:00:46', '00:00:47'])))
- d = pd.DataFrame(table)
- print '\n'*3, d
- pv = d.pivot(index='MA', columns='TY', values='TS')
- print '\n'*3, pv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement