This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import refinitiv.data as rd | |
try: | |
rd.open_session( # This will fail in CodeBook | |
name="desktop.workspace", # This (i.e.: the desktop session) nesesitates users to run Workspace or Eikon on the machine where the code is run. | |
config_name="C:/Example.DataLibrary.Python-main/Configuration/refinitiv-data.config.json") | |
except: | |
rd.open_session() # This sicceeds in CodeBook | |
fields_list =[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import refinitiv.data as rd | |
from refinitiv.data.content import search | |
import pandas as pd | |
import re | |
from typing import List | |
try: # The following libraries are not available in Codebook, thus this try loop. You can download `Example.DataLibrary.Python-main` at https://github.com/Refinitiv-API-Samples/Example.DataLibrary.Python/tree/main/Configuration | |
rd.open_session(config_name="C:\\Example.DataLibrary.Python-main\\Example.DataLibrary.Python-main\\Configuration\\refinitiv-data.config.json") | |
rd.open_session("desktop.workspace") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# # Import `Refinitiv Data Platform` Library and authentify ourselves to its services. | |
import refinitiv.dataplatform as rdp | |
# ## In CodeBook: | |
# rdp.open_desktop_session('DEFAULT_CODE_BOOK_APP_KEY') | |
## Outside CodeBook: | |
rdp_key = open("eikon.txt", "r") # The key is placed in a text file so that it may be used in this code without showing it itself. | |
rdp.open_desktop_session(str(rdp_key.read())) | |
rdp_key.close() # It is best to close the files we opened in order to make sure that we don't stop any other services/programs from accessing them if they need to. |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 22 columns, instead of 16. in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,Consumption (monthly data),Investment (quarterly data),Investment (monthly step data),Government Investment (quarterly data),Government Investment (monthly step data),Net Exports (quarterly data),Net Exports (monthly step data),GDP Component Sum (quarterly data),GDP Component Sum (monthly step data),GDP (every quarter),GDP (monthly step data),Investment fitted values (monthly step data),Investment forecasts (monthly step data),Investment fitted values' real errors (monthly step data),Government Investment fitted values (monthly step data),Government Investment forecasts (monthly step data),Government Investment fitted values' real errors (monthly step data),Net Exports (monthly step data) positive,Net Exports fitted values (monthly step data),Net Exports forecasts (monthly step data),Net Exports fitted values' real errors (monthly step data) | |
1950-02-01,NaN,4.472500e+10,4.472500e+10,4.895600e+10,4.895600e+10,2.203000e+09,2.203000e+09,NaN,NaN,2.808280e+11,2.808280e+11,4.473305e+10,NaN,8.046422e+06,4.874360e+10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mean of Absolute Values | ||
---|---|---|
Investment forecasts (monthly step data) | 3.66466e+12 | |
Investment fitted values' real errors (monthly step data) | 7.88281e+09 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Consumption (monthly data) | Investment (quarterly data) | Investment (monthly step data) | Government Investment (quarterly data) | Government Investment (monthly step data) | Net Exports (quarterly data) | Net Exports (monthly step data) | GDP Component Sum (quarterly data) | GDP Component Sum (monthly step data) | GDP (every quarter) | GDP (monthly step data) | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
1950-02-01 | NaN | 4.472500e+10 | 4.472500e+10 | 4.895600e+10 | 4.895600e+10 | 2.203000e+09 | 2.203000e+09 | NaN | NaN | 2.808280e+11 | 2.808280e+11 | |
1950-03-01 | NaN | NaN | 4.472500e+10 | NaN | 4.895600e+10 | NaN | 2.203000e+09 | NaN | NaN | NaN | 2.808280e+11 | |
1950-04-01 | NaN | NaN | 4.472500e+10 | NaN | 4.895600e+10 | NaN | 2.203000e+09 | NaN | NaN | NaN | 2.808280e+11 | |
1950-05-01 | NaN | 4.945800e+10 | 4.945800e+10 | 4.964300e+10 | 4.964300e+10 | 1.643000e+09 | 1.643000e+09 | NaN | NaN | 2.903830e+11 | 2.903830e+11 | |
1950-06-01 | NaN | NaN | 4.945800e+10 | NaN | 4.964300e+10 | NaN | 1.643000e+09 | NaN | NaN | NaN | 2.903830e+11 | |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | |
2020-03-01 | 1.390677e+13 | NaN | 3.669469e+12 | NaN | 3.850661e+12 | NaN | -5.261540e+11 | NaN | 2.090074e+13 | NaN | 2.1534 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 30 columns, instead of 29. in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,USAWP (monthly data),USAWPD (monthly data),USAWPG (monthly data),NNTC (monthly data),NNTC in trillions (monthly data),NBSOPID (quarterly data),NRTC (monthly data),NRTC in trillions (monthly data),NRTCPW (monthly data),RGDP (quarterly data),RGDP (monthly data),RGDP in trillions (quarterly data),RGDPPW (monthly data),RGDPPWTNRTCPWR (monthly data),RGDPPWTNRTCPWR regressed on months,RGDPPWTNRTCPWR regressed on months' errors,RGDPPWTNRTCPWRHW fitted values (monthly data),RGDPPWTNRTCPWRHW forecasts (monthly data),RGDPPWTNRTCPWRHW fitted values' real errors (monthly data),RGDPPWTNRTCPWRHW fitted values' real errors from 1990-01-01 (monthly data),RGDPPWTNRTCPWRHW model in sample plus one forecast,RGDPPWTNRTCPWRHW model in sample plus one forecast error,r,r_f,RGDPPW estimates,RGDPPW estimates' errors,RGDPPW estimates' proportional errors,RGDPPW estimates' errors every quarter,RGDP estimates | |
1950-01-01,57635000.0,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,Na |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RGDP (monthly data) | RGDP estimates | ||
---|---|---|---|
1990-02-01 | 5.872701e+12 | 5.805637e+12 | |
1990-03-01 | 5.872701e+12 | 5.856728e+12 | |
1990-04-01 | 5.872701e+12 | 5.914031e+12 | |
1990-05-01 | 5.960028e+12 | 5.846246e+12 | |
1990-06-01 | 5.960028e+12 | 5.925746e+12 | |
... | ... | ... | |
2019-11-01 | 2.172912e+13 | 2.168854e+13 | |
2019-12-01 | 2.172912e+13 | 2.174243e+13 | |
2020-01-01 | 2.172912e+13 | 2.185292e+13 |
NewerOlder