Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Refinitiv Data Platform /
  • Refinitiv Data Platform Libraries /
avatar image
Question by jasmine.lee · Nov 04, 2020 at 02:41 PM · rdp apisnapshotattributeerror

AttributeError: 'DataFrame' object has no attribute 'convert_dtypes'

Hi, I am trying to use the API rdp.get_snapshot() on jupyter notebook (with Python 3.6.10, pandas 1.1.3 and refinitiv-dataplatform 1.0.0a6) but it has returned

AttributeError: 'DataFrame' object has no attribute 'convert_dtypes'

Does anyone have a clue? Thanks.


Here is my code:

import refinitiv.dataplatform as rdp

import pandas as pd

APP_KEY = ''

RDP_LOGIN = ''

RDP_PASSWORD = ''

GRANT = rdp.GrantPassword(username=RDP_LOGIN, password=RDP_PASSWORD)

session = rdp.open_platform_session(APP_KEY, GRANT)

snap = rdp.get_snapshot(['EUR='],['BID'])


1604500666201.png (69.8 KiB)
1604500709353.png (73.5 KiB)

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

5 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jirapongse.phuriphanvichai · Nov 06, 2020 at 04:33 AM

@jasmine.lee

I have checked the source code of pandas 1.1.3 at https://github.com/pandas-dev/pandas/blob/v1.1.3/pandas/core/generic.py#L5179.

The source code at line 5179 doesn't match the application's call stack.

However, it matches pandas 0.25.3 instead: https://github.com/pandas-dev/pandas/blob/v0.25.3/pandas/core/generic.py#L5179.

You may need to verify the version of Pandas in the ~\AppData\Local\Continuum\anacondas3\envs\refiniitv\lib\site-packages\pandas directory.

pd.__version__

1604636669007.png (14.8 KiB)
1604636785413.png (57.3 KiB)
Comment
jasmine.lee

People who like this

1 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
jirapongse.phuriphanvichai ♦♦ · Nov 06, 2020 at 04:34 AM 0
Share

https://github.com/pandas-dev/pandas/blob/v0.25.3/pandas/core/generic.py#L5179.

1604637237534.png (14.7 KiB)
avatar image
jasmine.lee · Nov 12, 2020 at 07:57 AM 0
Share

You are indeed correct on the Pandas version. It returned version 0.25.3

It seems I may have multiple versions of Pandas installed. How do I make sure I can consolidate these versions or to call the latest/suitable version?

avatar image
REFINITIV
Answer by umer.nalla · Nov 04, 2020 at 02:57 PM

Hi @jasmine.lee

There were several issues addressed in the 1.0.0a7 build - are you able to try that out?

https://pypi.org/project/refinitiv-dataplatform/1.0.0a7/


Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by wasin.waeosri · Nov 05, 2020 at 03:43 AM

Hello @jasmine.lee

Based on our discussion yesterday, I am noticed that your username is a "machine-id" (GE-XXXXXXXXXXXX) which aims to use with Refinitiv Real-Time Optimized (aka ERT in Cloud) to get a streaming data, not to use with RDP REST API. The username for your RDP should be in email format.

Could you please also test /data/pricing/beta3/snapshots endpoint in RDP API Docs page?



rdp.png (105.8 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Answer by moragodkrit.chumsri_1 · Nov 05, 2020 at 04:29 AM

@jasmine.lee

I can't replicate the issue with 1.0.0.6a; it could be an issue about your account, as Wasin said. Please test your account with APIDocs first.

I have created a new env with python 3.6 RDP 1.0.0.6a with the same pandas' version and then install httpx 0.14.2 to avoid the issue when opening a session as mentioned in

https://community.developers.refinitiv.com/questions/66645/rdp-libraries-request-object-has-no-attribute-prep.html


Then I just call

snap = rdp.get_snapshot(['EUR='],['BID'])

And get the data as expected.

Actually, the internal codes try to get data using the following query parameters to the endpoint.

https://api.refinitiv.com/data/pricing/beta3/snapshots?universe=EUR%3D&fields=BID

You may add

session.set_log_level(6)

after the code to open a session. It should print an additional log in the notebook.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by jasmine.lee · Nov 12, 2020 at 07:56 AM

@jirapongse.phuriphanvichai

You are indeed correct on the Pandas version. It returned version 0.25.3

It seems I may have multiple versions of Pandas installed. How do I make sure I can consolidate these versions or to call the latest/suitable version?

Comment

People who like this

0 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
jirapongse.phuriphanvichai ♦♦ · Nov 13, 2020 at 05:32 AM 0
Share

@jasmine.lee

You may consider using Python Virtualenv. It is a tool to create isolated Python environments. There are a lot of Virtualenv usages and articles. For example:

  • Create Virtual Environment using “virtualenv” and add it to Jupyter Notebook
  • Using Virtual Environments in Jupyter Notebook and Python
avatar image
REFINITIV
wasin.waeosri ♦♦ · Nov 13, 2020 at 06:43 AM 0
Share

Hello @jasmine.lee

The other tool that can help you to isolate Python environment (Python version, RDP version, pandas version, etc) is Anaconda and MiniConda.

Please see how to use miniconda to setup environment for Python API in "Setting up a Python development environment" section of Eikon Data API tutorial. The tutorial uses Eikon Data API as an example which can be applied to RDP libraries too.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

I signed up on this platform to access live stock market data but can't get the API access credentials to use the .NET library. I keep getting the 401 error page even for the quickstart page (details below). Is it a general problem or is it just for me?

RDP libraries: 'Request' object has no attribute 'prepare'

new_status_code not defined in OMMStream _on_status in omm_stream.py

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges