question

Upvotes
Accepted
5 1 1 3

Dropping "Field" from datastream dataframe

Hi,

I have a number of tickers for which I'm grabbing a time series via the following (as an example):

Ticker1_df=ds.get_data (tickers=Ticker1, fields=[Field1], start=start_date_qtr, end=end_date, kind=1)

The specific tickers/fields don't really matter at this point, but my main question is regarding the resultant dataframe. In the dataframe, there are two descriptive rows included ("Instrument" and "Field") and I'm not sure how to remove them (i.e., "Fields"). Bottom line is I'm trying to plot a combined dataframe downstream and can't seem to do so in the default dataframe. How should I go about transforming the dataframe that includes "Instrumenet" and "Field" so that it can be charted?

Thanks.

datastream
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
5 1 1 3

Nevermind the question. Figured it out with the below:

Combined_df.columns = Combined_df.columns.droplevel(1)
icon clock
10 |1500

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

Click below to post an Idea Post Idea