question

Upvotes
Accepted
3 0 0 1

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.


pythondatastream-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
38.1k 71 35 53

@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).


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea