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'])
Best Answer
-
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__
0
Answers
-
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/
0 -
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?
0 -
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
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.
0 -
@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?
0 -
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?
0 -
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:
0 -
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.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 250 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛