python pydatastream DS.fetch() results are sorted?

I would like to extract data using Pydatastream module using Datastream ISIN code as following:

data = DS.fetch(['US91835J2078','KR7114630007'], ['X(UP)~U$','X(P)~U$','VO'], date_from='2021-09-27')

I was able to obtain 'data', but the result is sorted in the order of KRxxxx and USxxxx. I don't know why they are sorted in ascending order, but I would like to have data in the original order as shown in ['USxxxx', 'KRxxxx']. I have extensive ISIN list, so it is important to get the data as intended. There must be a simple on/off switch to get the result, but I cannot find the solution. Can someone help me how to get the result as intended?

Thanks.


Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @bjleend

    I checked and found that the pydatastream library sorts the data. You can refer to the source code on GitHub. You can contact the library owner to verify it.

    Otherwise, you can generate the data frame by using the retrieved raw data (DS._last_response_raw).