2

I had some code in which I had a Pandas Series, called index, and I dropped values from that using tickers.drop()

It was of the form:

Index([u'EUR3m', u'EUR3m3m', u'EUR6m3m', u'EUR9m3m', u'EUR1y', u'EUR1y1y',
       u'EUR2y1y'],
      dtype='object')

However, I am rewriting some code, and in this instance, I only have an array:

array([u'EUR3m', u'EUR3m3m', u'EUR6m3m', u'EUR9m3m', u'EUR1y', u'EUR1y1y',
       u'EUR2y1y'], dtype=object)

I cant locate the function to convert from array to index?

1
  • 2
    Pandas? If so, please tag it appropriately. Commented Sep 13, 2018 at 11:56

1 Answer 1

1

I think converting to Index is not necessary, simply assign it or use DataFrame.set_index:

df.index = arr

Or:

df = df.set_index(arr)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.