Anonymous
Как сохранить индекс моего пандаса данных DataFrame после нормального введения. json
Сообщение
Anonymous » 16 май 2025, 18:25
Я получаю объект json от загрузки JSON.
Затем я делаю Pd df
Теперь мне нужно нормализовать много вложенной информации, которая скрывает в единственном столбце ['open']
Но я хочу сохранить оригинальный индекс, у индекса есть мой идентификатор моего порядка < /p>
.
Код: Выделить всё
{'error': [], 'result': {'open': {'OOACET-BMAFM-HNCONR': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605592530.3912, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14650.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14650.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OXJ3XN-56LKL-AJ47T4': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560760.209, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13625.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13625.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OWS5QG-43O6P-GJ6D3I': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560759.2277, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13650.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13650.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O2E3V6-FVR32-MSEK5M': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560758.7409, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13675.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13675.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OPBWN7-76LCH-PUFKBP': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560758.2586, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13700.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13700.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OLMJHD-U2A2V-LUDNMQ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560757.7803, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13725.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13725.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OK4BTF-RUBIU-SYBI3H': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560756.9636, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13750.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13750.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OWPO6O-2ITKQ-7PYNRD': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560755.88, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13775.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13775.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OI4N5X-4XJNM-65ZVKK': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560755.409, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13800.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13800.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OQJNLK-IJ5EC-KAJFZM': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559538.5429, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14625.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14625.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OX4PEP-CQJF3-D5S4T4': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559538.0649, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14600.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14600.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OTPY3E-P6ZNO-AKMFGS': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559537.5156, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14575.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14575.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'ODPOEU-WSSWG-JOAXFX': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559536.9612, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14550.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14550.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OERE3J-DZZDJ-IWYECU': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605554852.1838, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14525.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14525.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OVWFP7-6KLAD-FGQO6C': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605554707.2403, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14500.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14500.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OZB6V4-5SVQJ-Y6ADNE': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605554448.1384, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13950.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13950.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O3FCJ5-VZQHF-MDAFQ2': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605549359.8677, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14475.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14475.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OC6GIB-QVZOY-O4BWHZ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605549347.6533, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14450.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14450.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OMR6HL-NYYKP-3XJ3AI': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605549336.5905, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14425.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14425.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O2BL5K-CGDVD-ROA3ID': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548975.3411, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14400.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14400.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OH4E4L-6NLAW-GKYPZ5': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548959.0035, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14375.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14375.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'ODH7V6-2ZUVJ-EKX7EB': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548922.068, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14350.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14350.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OVTUAA-HGYRL-JX2GUH': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548906.3953, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14325.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14325.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O32BWW-7UB4U-N74YUK': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548887.2891, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14300.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14300.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OCKQOP-JAKQO-63O6QI': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605547701.2241, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13925.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13925.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OA4LK5-G7TDS-JMAN4D': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605544664.1199, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13900.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13900.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OS4MJ5-3CZIC-2NBYCQ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605544646.2401, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13875.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00200000 XBTEUR @ limit 13875.0', 'close': ''}, 'vol': '0.00200000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OG3IGS-H26YR-Q4JIJW': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605544494.1551, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14275.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14275.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OUCDM5-5GO4N-V7L4LN': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605543699.4908, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13850.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13850.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OPY3OV-OQGE2-76BFHJ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605543686.7376, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13825.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13825.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}}}}
< /code>
Вот информация JSON как df < /p>
O2BL5K-CGDVD-ROA3ID {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548975.3411, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14400.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14400.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}
O2E3V6-FVR32-MSEK5M {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560758.7409, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13675.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13675.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}
O32BWW-7UB4U-N74YUK {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548887.2891, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14300.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14300.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}
< /code>
Вот код, который я использовал до сих пор. < /p>
data = json.loads(subprocess.check_output('python -m krakenapi OpenOrders'))
df = pd.DataFrame(data['result'])
df2 = pd.json_normalize(df['open'])
< /code>
Но теперь я потерял идентификатор заказа < /p>
Я попробовал несколько вещей, чтобы нормализовать, например, немедленно, но я в конечном итоге стану странным DFS < /p>
Мне действительно нужно «просто» в конечном итоге с помощью данных, который имеет все столбцы в ['result'], ['Open']
, в то время как оригинал, изначально изначально созданные в основе Индекс, который содержит все мои идентификаторы заказа.
мне больше не нужно быть индексом. Меня можно было бы хранить в столбце, но мне нужно знать, что правильный идентификатор фиксируется в правильном порядке.
Как очевидно, я думаю.df = pd.DataFrame(data['result'], index = id_set [:, 2:5])
Код: Выделить всё
df2 = pd.json_normalize(df['open'], index = )
, но все без успеха, так как это неожиданный аргумент или строковый объект не имеет значений
Подробнее здесь:
https://stackoverflow.com/questions/648 ... ation-json
1747409124
Anonymous
Я получаю объект json от загрузки JSON. Затем я делаю Pd df Теперь мне нужно нормализовать много вложенной информации, которая скрывает в единственном столбце ['open'] Но я хочу сохранить оригинальный индекс, у индекса есть мой идентификатор моего порядка < /p> .[code]{'error': [], 'result': {'open': {'OOACET-BMAFM-HNCONR': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605592530.3912, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14650.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14650.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OXJ3XN-56LKL-AJ47T4': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560760.209, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13625.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13625.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OWS5QG-43O6P-GJ6D3I': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560759.2277, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13650.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13650.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O2E3V6-FVR32-MSEK5M': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560758.7409, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13675.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13675.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OPBWN7-76LCH-PUFKBP': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560758.2586, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13700.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13700.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OLMJHD-U2A2V-LUDNMQ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560757.7803, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13725.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13725.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OK4BTF-RUBIU-SYBI3H': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560756.9636, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13750.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13750.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OWPO6O-2ITKQ-7PYNRD': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560755.88, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13775.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13775.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OI4N5X-4XJNM-65ZVKK': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560755.409, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13800.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13800.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OQJNLK-IJ5EC-KAJFZM': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559538.5429, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14625.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14625.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OX4PEP-CQJF3-D5S4T4': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559538.0649, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14600.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14600.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OTPY3E-P6ZNO-AKMFGS': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559537.5156, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14575.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14575.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'ODPOEU-WSSWG-JOAXFX': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605559536.9612, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14550.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14550.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OERE3J-DZZDJ-IWYECU': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605554852.1838, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14525.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14525.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OVWFP7-6KLAD-FGQO6C': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605554707.2403, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14500.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14500.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OZB6V4-5SVQJ-Y6ADNE': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605554448.1384, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13950.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13950.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O3FCJ5-VZQHF-MDAFQ2': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605549359.8677, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14475.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14475.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OC6GIB-QVZOY-O4BWHZ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605549347.6533, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14450.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14450.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OMR6HL-NYYKP-3XJ3AI': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605549336.5905, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14425.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14425.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O2BL5K-CGDVD-ROA3ID': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548975.3411, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14400.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14400.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OH4E4L-6NLAW-GKYPZ5': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548959.0035, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14375.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14375.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'ODH7V6-2ZUVJ-EKX7EB': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548922.068, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14350.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14350.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OVTUAA-HGYRL-JX2GUH': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548906.3953, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14325.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14325.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'O32BWW-7UB4U-N74YUK': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548887.2891, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14300.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14300.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OCKQOP-JAKQO-63O6QI': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605547701.2241, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13925.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13925.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OA4LK5-G7TDS-JMAN4D': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605544664.1199, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13900.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13900.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OS4MJ5-3CZIC-2NBYCQ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605544646.2401, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13875.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00200000 XBTEUR @ limit 13875.0', 'close': ''}, 'vol': '0.00200000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OG3IGS-H26YR-Q4JIJW': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605544494.1551, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14275.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14275.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OUCDM5-5GO4N-V7L4LN': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605543699.4908, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13850.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13850.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}, 'OPY3OV-OQGE2-76BFHJ': {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605543686.7376, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13825.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00102000 XBTEUR @ limit 13825.0', 'close': ''}, 'vol': '0.00102000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'}}}} < /code> Вот информация JSON как df < /p> O2BL5K-CGDVD-ROA3ID {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548975.3411, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14400.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14400.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'} O2E3V6-FVR32-MSEK5M {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605560758.7409, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'buy', 'ordertype': 'limit', 'price': '13675.0', 'price2': '0', 'leverage': 'none', 'order': 'buy 0.00100000 XBTEUR @ limit 13675.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'} O32BWW-7UB4U-N74YUK {'refid': None, 'userref': 0, 'status': 'open', 'opentm': 1605548887.2891, 'starttm': 0, 'expiretm': 0, 'descr': {'pair': 'XBTEUR', 'type': 'sell', 'ordertype': 'limit', 'price': '14300.0', 'price2': '0', 'leverage': 'none', 'order': 'sell 0.00100000 XBTEUR @ limit 14300.0', 'close': ''}, 'vol': '0.00100000', 'vol_exec': '0.00000000', 'cost': '0.00000', 'fee': '0.00000', 'price': '0.00000', 'stopprice': '0.00000', 'limitprice': '0.00000', 'misc': '', 'oflags': 'fciq'} < /code> Вот код, который я использовал до сих пор. < /p> data = json.loads(subprocess.check_output('python -m krakenapi OpenOrders')) df = pd.DataFrame(data['result']) df2 = pd.json_normalize(df['open']) < /code> Но теперь я потерял идентификатор заказа < /p> Я попробовал несколько вещей, чтобы нормализовать, например, немедленно, но я в конечном итоге стану странным DFS < /p> Мне действительно нужно «просто» в конечном итоге с помощью данных, который имеет все столбцы в ['result'], ['Open'] , в то время как оригинал, изначально изначально созданные в основе Индекс, который содержит все мои идентификаторы заказа. мне больше не нужно быть индексом. Меня можно было бы хранить в столбце, но мне нужно знать, что правильный идентификатор фиксируется в правильном порядке. Как очевидно, я думаю.df = pd.DataFrame(data['result'], index = id_set [:, 2:5])[/code] [code]df2 = pd.json_normalize(df['open'], index = )[/code] , но все без успеха, так как это неожиданный аргумент или строковый объект не имеет значений Подробнее здесь: [url]https://stackoverflow.com/questions/64872676/how-to-keep-the-index-of-my-pandas-dataframe-after-normalazation-json[/url]