question

Upvotes
Accepted
27 0 0 2

How do I get the curve data without headers -RDMS Python scripts

How do I get the curve data without headers- for Python Scripts

The data comes across as a json object but was wondering how to receive the data straight as a numpy array?

#technologypython apirdms
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.

Hi @vinaya.shetty0 ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

@vinaya.shetty0

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvote
Accepted
14.2k 30 5 10

Hi @vinaya.shetty0 ,

From the JSON result returned from RDMS, it can be tranformed to numpy array with the Pandas DataFrame constructor as below

import pandas as pd
pd.DataFrame(d).values

The .values part on the end converts the result to a NumPy array, which is what you asked for. Some people would just work directly with the DataFrame instead.

1705907805083.png


1705907805083.png (123.4 KiB)
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.