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__
1
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
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛