addisonlynch / addisonlynch/iex-examples

Running into issues with get_historical_data for multiple symbols

Aberta
#6 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Sem dados de linguagem
Estrelas
24
Forks
7
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

Hi,

I have been trying to acquaint myself with this package and when I tried to run examples listed, I am running into the following error

UnsortedIndexError: 'MultiIndex slicing requires the index to be lexsorted: slicing on levels [1], lexsort depth 0'

when I tried to query as below:
from iexfinance.stocks import get_historical_data
import os
from iextoken import IEX_CLOUD_API_TOKEN
from datetime import datetime
import pandas as pd

os.environ['IEX_API_VERSION'] = 'sandbox'
os.environ['IEX_TOKEN'] = IEX_CLOUD_API_TOKEN
os.environ['IEX_OUTPUT_FORMAT']='pandas'

start_date = datetime(2021,1,1)
end_date = datetime(2021,3,12)
symbols = ["AAPL", "TSLA", "MSFT"]
get_historical_data(symbols, output_format='pandas',close_only=True)

When I did the same query for 1 symbol instead of multiple symbols, query was successful. Am I doing something wrong? Please advise.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

The reported entry point is get_historical_data with output_format='pandas' and multiple symbols. Start by reproducing the supplied AAPL, TSLA, and MSFT call, then compare its result with the single-symbol query and inspect the resulting pandas MultiIndex. Done means multiple-symbol historical data works without UnsortedIndexError while the existing single-symbol behavior remains successful.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
pandas, python
Domínio
api, data
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.