I have a pd.DataFrame listing wire gauges and their corresponding currents:
e_ref =
wire_gauge current
0 14 15
1 12 20
2 10 30
3 8 50
4 6 60
5 4 85
6 3 100
7 2 115
Another DataFrame contains switch lists in the system:
system =
breakers
0 30
1 20
2 30
3 15
4 30
I need to add the column "explorer" to the DataFrame system from the columns "wire_gauge" e_ref DataFrame, looking at the interrupt value in the current series e_ref.
so the output will be:
breakers wire_gauge
0 30 10
1 20 12
2 30 10
3 15 14
4 30 10
I continue to mix multiple responses from another post and currently do not have a working pandas solution. I can make this work with python loops, but I feel there is one here
The following are the types of solutions I'm working on:
df.ix[df.breakers.isin(e_ref['current']), 'wire_gauge'] = e_ref['wire_gauge']
and
df['wire_gauge']=e_ref.loc[e_ref['current'] == df['breakers'] ]
Thank you for your time and direction!