1

I have two dataframes: subhalo_field and halo_field

  halo_index
0 3447
1 3447
2 5286
3 3124
4 3124
...

So halo_index column values are not unique. My other dataframe is halo_field:

  index rh
0 3447  2
1 5286  5
2 3124  10
...

halo_field.index values are unique and featuring in subhalo_field.halo_index column (some of then a lot of times). I want to add column to subhalo_field dataframe (first one) so it looks like this:

  halo_index rh
0 3447       2
1 3447       2
2 5286       5
3 3124       10
4 3124       10
...

Can you help me do that please?

USB
  • 6,019
  • 15
  • 62
  • 93
elizevin
  • 101
  • 1
  • 9

0 Answers0