python - Merging pandas dataframe indices -




how can merge 2 indices

index1 out[8]: int64index([22, 23, 24, 25, 32, 33, 34], dtype='int64')  index2 out[8]: int64index([20, 23, 24, 25, 32, 33, 34], dtype='int64') 

so obtain

index3 out[8]: int64index([20, 22, 23, 24, 25, 32, 33, 34], dtype='int64') 

that contains index1 , index2 without duplicates?

use union

in [1331]: index1.union(index2) out[1331]: int64index([20, 22, 23, 24, 25, 32, 33, 34], dtype='int64') 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -