I would like to retrieve the following (historical) information while using the
ek.get_data()
function: ISIN, MSNR,MSNP, MSPI, NR, PI, NT
for some equity indices, take ".STOXX" as an example. How do I do that? I want to specify I am using the get data function instead of the timeseries function because I need daily data and I would not respect the 3k rows limit in get.timeseries.
In general: how do I get to know the right names for the fields that I have to use inside the
ek.get_data()
function? I tried with both the codes that the Excel Eikon program uses and also the names used in the Eikon browser but they differ quite a lot from the example I saw in some sample code on the web (eg. TR.TotalReturnYTD vs TR.PCTCHG_YTD. How do I get to understand what would be the right name for the data types I need?
Considering the codes in your function (ISIN, MSNR,MSNP, MSPI, NR, PI, NT), I'd guess you are interested in the Datastream dataset. You are probably beter off using the DataStream WebServices (DSWS) API instead of the Eikon API. This will also relieve you off your 3k row limit.
Related
I'm an absolute novice here, but know my way around some Netsuite formulas and data concepts. I have a report that lists all PACK SKUs (Kit/Bundle) and their component SKUs along with the quantity for each component that makes up the PACK. This is similar to BOMs.
I have used decode function in other saved searches to transpose data in columns, but I'm super confused about how to achieve this for Pack/Components.
There is no individual identifier such as component(a) component (b) that I can identify. These are also not under {memberitems} and looks like the company had this restructured to be under PACK/Component structure.
Is there anyway I can get the many components automatically listed in columns with their quantities next to it? Or, is there a potential Python script or an Excel Macro that might be able to assist with 800k rows? Any help would be highly appreciated.
data snapshot
I am an elementary Python programmer and have been using this module called "Pybaseball" to analyze sabermetrics data. When using this module, I came across a problem when trying to retrieve information from the program. The program reads a CSV file from any baseball stats site and outputs it onto a program for ease of use but the problem is that some of the information is not shown and is instead all replaced with a "...". An example of this is shown:
from pybaseball import batting_stats_range
data = batting_stats_range('2017-05-01', '2017-05-08')
print(data.head())
I should be getting:
https://github.com/jldbc/pybaseball#batting-stats-hitting-stats-for-players-within-seasons-or-during-a-specified-time-period
But the information is cutoff from 'TM' all the way to 'CS' and is replaced with a ... on my code. Can someone explain to me why this happens and how I can prevent it?
As the docs states, head() is meant for "quickly testing if your object has the right type of data in it." So, it is expected that some data may not show because it is collapsed.
If you need to analyze the data with more detail you can access specific columns with other methods.
For example, using iloc(). You can read more about it here, but essentially you can "ask" for a slice of those columns and then apply a new slice to get only nrows.
Another example would be loc(), docs here. The main difference being that loc() uses labels (column names) to filter data instead of numerical order of columns. You can filter a subset of specific columns and then get a sample of rows from that.
So, to answer your question "..." is pandas's way of collapsing data in order to get a prettier view of the results.
I have a bit of code that will download minute to minute data historically from binance, and combine it all into their own CSV. EG: BCHUSDT-1m-data.csv, BTCUSDT-1m-data.csv, etc for whatever pairs I want. However, I keep getting a
requests.exceptions.ChunkedEncodingError connectionreset error 10054 (closed by remote host).
Is there a better way to go about getting this information than using the client.get_historical_klines(interval) method? Ideally I would want even more granular data (30s, 15, or even 1s if at all possible historically). Thanks in advance!
Link to API: Python-Binance API
For less than 1m trades you need to use
trades = client.get_historical_trades(symbol='BNBBTC')
or
trades = client.get_aggregate_trades(symbol='BNBBTC')
The last one is better it cost less weight and contains more information
Then if you want to combine it to candles/klines you can use pandas resample or ohlc function.
I am currently using
tCursors=tuple(cursors)
for row in myTable.GetRows(tCursors):
for i in range(0,len(cursors)):
curValue=cursors[i].CurrentValue
to get values from a data table in spotfire. The tuple contains the cursors for all of the columns that I am interested in. Is there a faster way to obtain multiple values from the data table, possibly loading them into an array, or loading the entire data table into a 2d array?
Sorry that this is vague, I am just not sure what options I have to get the data from the spotfire table into python in a format that can be used. Thank you
If you want to process large data set, you should use R (aka datafunctions).
Python is good to manipulate Spotfire elements thanks to the possibility to modify C# elements with the API.
R is good to manipulate data, you can easily perform calculation, aggregation, pivot etc. It is really faster than Ironpython for operations on data.
Here are some great resources to help you start with R:
The official R documentation
Documentation to manipulate data
R is widely used, so you can easily find chunks of code on the web to achieve what you want to do.
I'm using the sample Python Machine Learning "IRIS" dataset (for starting point of a project). These data are POSTed into a Flask web service. Thus, the key difference between what I'm doing and all the examples I can find is that I'm trying to load a Pandas DataFrame from a variable and not from a file or URL which both seem to be easy.
I extract the IRIS data from the Flask's POST request.values. All good. But at that point, I can't figure out how to get the pandas dataframe like the "pd.read_csv(....)" does. So far, it seems the only solution is to parse each row and build up several series I can use with the DataFrame constructor? There must be something I'm missing since reading this data from a URL is a simple one-liner.
I'm assuming reading a variable into a Pandas DataFrame should not be difficult since it seems like an obvious use-case.
I tried wrapping with io.StringIO(csv_data), then following up with read_csv on that variable, but that doesn't work either.
Note: I also tried things like ...
data = pd.DataFrame(csv_data, columns=['....'])
but got nothing but errors (for example, "constructor not called correctly!")
I am hoping for a simple method to call that can infer the columns and names and create the DataFrame for me, from a variable, without me needing to know a lot about Pandas (just to read and load a simple CSV data set, anyway).