json


  • https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json is not pulling data,

    raceback (most recent call last):
    File "/usr/local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2898, in get_loc
    return self._engine.get_loc(casted_key)
    File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
    KeyError: 'expiry'
    Traceback (most recent call last):

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "/home/noufimk/01_straddle_basic_9_20_repeat_on_strike_changes_NF_reentry.py", line 214, in <module>
    token_df['expiry'] = pd.to_datetime(token_df['expiry']).apply(lambda x: x.date())
    File "/usr/local/lib/python3.9/site-packages/pandas/core/frame.py", line 2906, in getitem
    indexer = self.columns.get_loc(key)
    File "/usr/local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
    raise KeyError(key) from err
    KeyError: 'expiry'


  • @raseenanoufal said in json:

    https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json dinosaur game is not pulling data,

    raceback (most recent call last):
    File "/usr/local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2898, in get_loc
    return self._engine.get_loc(casted_key)
    File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
    File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
    File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
    KeyError: 'expiry' )
    Traceback (most recent call last):

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
    File "/home/noufimk/01_straddle_basic_9_20_repeat_on_strike_changes_NF_reentry.py", line 214, in <module>
    token_df['expiry'] = pd.to_datetime(token_df['expiry']).apply(lambda x: x.date())
    File "/usr/local/lib/python3.9/site-packages/pandas/core/frame.py", line 2906, in getitem
    indexer = self.columns.get_loc(key)
    File "/usr/local/lib/python3.9/site-packages/pandas/core/indexes/base.py", line 2900, in get_loc
    raise KeyError(key) from err
    KeyError: 'expiry'

    I got the same error