Created
April 11, 2019 14:51
-
-
Save samchaaa/4ba43aaf52edc3ce9acf4028a05c3ac2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
oc = pd.DataFrame([line.strip('\n').split(',') for line in open('../../Downloads/quotedata.dat')]) | |
oc.head() | |
oc.columns = oc.loc[2, :] | |
oc = oc.loc[3:] | |
oc['Calls K'] = oc.apply(lambda x: float(x['Calls'][-6:-2])/10, axis=1) | |
oc['Puts K'] = oc.apply(lambda x: float(x['Puts'][-6:-2])/10, axis=1) | |
sorted(oc['Calls K'].unique()) | |
sorted(oc['Puts K'].unique()) | |
oc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment