Giter Club home page Giter Club logo

vix's Issues

Failed to run the notebook with python 3.12 and Pandas 2.2.2

The error happened in this line:
options4['dK'] = options4.groupby(level = ['Date','Days'])['Strike'].apply(compute_adjoining_strikes_diff)

Exception has occurred: ValueError
cannot handle a non-unique multi-index!

options4 shape is (246,3)
options4.index is MultiIndex, like
MultiIndex([('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
('2009-01-01', 9),
...
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37),
('2009-01-01', 37)],
names=['Date', 'Days'], length=246)

So any idea on this issue? Thanks!

KeyError while running replicate vix code

Hi

I am getting KeyError while running the replicate vix code. I have created both yield.csv and options.csv from the source file. But when I run the application, I get KeyError for 'P' ( I guess Puts).

Thanks
Mudit

Traceback (most recent call last):
File "../reproduce_vix.py", line 424, in
vixvalue = whitepaper()
File "../reproduce_vix.py", line 387, in whitepaper
options2 = put_call_parity(options2)
File "../reproduce_vix.py", line 175, in put_call_parity
options['CPdiff'] = (options['C'] - options['P']).abs()
File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 1969, in getitem
return self._getitem_column(key)
File "/usr/local/lib/python2.7/dist-packages/pandas/core/frame.py", line 1976, in _getitem_column
return self._get_item_cache(key)
File "/usr/local/lib/python2.7/dist-packages/pandas/core/generic.py", line 1091, in _get_item_cache
values = self._data.get(item)
File "/usr/local/lib/python2.7/dist-packages/pandas/core/internals.py", line 3211, in get
loc = self.items.get_loc(item)
File "/usr/local/lib/python2.7/dist-packages/pandas/core/index.py", line 1759, in get_loc
return self._engine.get_loc(key)
File "pandas/index.pyx", line 137, in pandas.index.IndexEngine.get_loc (pandas/index.c:3979)
File "pandas/index.pyx", line 157, in pandas.index.IndexEngine.get_loc (pandas/index.c:3843)
File "hashtable.pyx", line 668, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:11463)
File "hashtable.pyx", line 676, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:11416)
KeyError: 'P'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.