delalma
delalma

Reputation: 928

pandas series value lost when reindexing

I would like to reindex but I have a nan when doing it.

pnl np.array input:

2.859134e+08

my code:

pnl = pd.Series(pnl)
r = ['BCH']
pnl = pnl.reindex(r)

output

BCH   NaN

Upvotes: 0

Views: 42

Answers (1)

delalma
delalma

Reputation: 928

The following code answers the question.

r = ['BCH']
pnl = pd.Series(pnl, index=r)

Upvotes: 1

Related Questions