question

Upvotes
Accepted
3 0 1 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.

Hello @bjleend ,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

-AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

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