question

Upvotes
Accepted
3 0 0 2

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 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
78.1k 246 52 72

@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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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