alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
505 stars 125 forks source link

[Bug]: Duplicate Indicies #421

Closed bossdown123 closed 4 months ago

bossdown123 commented 4 months ago

Is there an existing issue for this?

Current Behavior

When i retrieve a Barset and convert it to a DataFrame the result contains duplicated indices

Expected Behavior

When i retrieve a Barset and convert it to a DataFrame the result should not contain duplicated indices

SDK Version I encountered this issue in

latest at the time

Steps To Reproduce

def get_bars(stock):
    request_params = StockBarsRequest(
        symbol_or_symbols=stock,
        timeframe=TimeFrame(30,TimeFrameUnit('Min')),
        start=index.min(),
        end=index.max(),
        #limit=1000,
        adjustment=Adjustment.ALL,
        feed='sip'
    )
    return  client.get_stock_bars(request_params)

df = barsets.df
df = df.T[stock].T.drop(['vwap','trade_count'], axis=1)
df = df[df.index.duplicated(keep=False)]
display(df)

Filled out the Steps to Reproduce section?

Anything else?

image

hiohiohio commented 4 months ago

@bossdown123 thank you for reporting the issue. confirmed. please let me investigate and fix this issue.

hiohiohio commented 4 months ago

@bossdown123 we have fixed this issue. Could you please try again to confirm when you have a chance?

bossdown123 commented 4 months ago

issue resolved