question

Upvotes
Accepted
5 3 3 5

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 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
5 3 3 5

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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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