Skip to content

Instantly share code, notes, and snippets.

@MichaelWS
MichaelWS / ptdump_of_panel
Created December 16, 2013 23:46
ptdump of panels
/ (RootGroup) ''
/._v_attrs (AttributeSet), 5 attributes:
[CLASS := 'GROUP',
FILTERS := Filters(complevel=9, complib='blosc', shuffle=True, fletcher32=False),
PYTABLES_FORMAT_VERSION := '2.1',
TITLE := '',
VERSION := '1.0']
/AR (Group) ''
/AR._v_attrs (AttributeSet), 15 attributes:
[CLASS := 'GROUP',
in 0.12
ex_date Unnamed: 0 asset_type cusip name shares value form_type accepted period company_name cik sec_id end_date
0 2002-11-08 00:00:00 0 COM 281020107 EDISON INTERNATI 2792500 27925000 13F-HR 2002-11-08 00:00:00 2002-09-30 00:00:00 APPALOOSA MANAGEMENT LP 0001006438 N03TRC-S-US 2002-11-08 00:00:00
4 2002-11-08 00:00:00 4 COM 453235103 INAMED CORPCOM 3669359 84395000 13F-HR 2002-11-08 00:00:00 2002-09-30 00:00:00 APPALOOSA MANAGEMENT LP 0001006438 M89FLH-S-US 2002-11-08 00:00:00
5 2002-11-08 00:00:00 5 COM 494580103 KINDRED HEALTHCA 2475427 91665000 13F-HR 2002-11-08 00:00:00 2002-09-30 00:00:00 APPALOOSA MANAGEMENT LP 0001006438 P7KT40-S-US 2002-11-08 00:00:00
6 2002-11-08 00:00:00 6 042006 494580111 KINDRED HEALTHCA 720398 5064000 13F-HR 2002-11-08 00:00:00 2002-09-30 00:00:00 APPALOOSA MANAGEME
@MichaelWS
MichaelWS / gist:7981451
Created December 16, 2013 02:14
dataframe
In [7]: us_df.head(10)
Out[7]:
date close country currency high id \
0 1993-01-04 00:00:00 5.382715 US USD 5.432099 B00CQC-S-US
1 1993-01-04 00:00:00 10.708334 US USD 10.833334 B01573-S-US
2 1993-01-04 00:00:00 NaN US USD NaN B07H91-S-US
3 1993-01-04 00:00:00 912.500000 US USD 912.500000 B15R2H-S-US
4 1993-01-04 00:00:00 6.442701 US USD 6.735551 B28D82-S-US
5 1993-01-04 00:00:00 28.091904 US USD 28.210185 B2DTQ7-S-US
6 1993-01-04 00:00:00 12.049219 US USD 12.172170 B2F13F-S-US
@MichaelWS
MichaelWS / ptdump
Created December 16, 2013 01:02
ptdump for table
/ (RootGroup) ''
/._v_attrs (AttributeSet), 5 attributes:
[CLASS := 'GROUP',
FILTERS := Filters(complevel=9, complib='blosc', shuffle=True, fletcher32=False),
PYTABLES_FORMAT_VERSION := '2.1',
TITLE := '',
VERSION := '1.0']
/AR (Group) ''
/AR._v_attrs (AttributeSet), 15 attributes:
[CLASS := 'GROUP',
@MichaelWS
MichaelWS / dataSourcecsv.py
Created June 28, 2013 18:41
example datasource of zipline
"""
leverage work of briancappello and quantopian team
(especcially twiecki, eddie, and fawce)
"""
import pandas as pd
from zipline.gens.utils import hash_args
from zipline.sources.data_source import DataSource
import datetime
import csv
import numpy as np