super noob here. Kinda left high & dry on some code that I am trying to fix with my very limited knowledge. Currently stuck on some python pandas code...
closest_price_final = pd.DataFrame(closest_price_df)
closest_price_final.columns = ['Label', 'Price Distance']
print(closest_price_final)
Label Price Distance
0 A1 47.033366
1 A2 104.566732
2 B1 176.803385
3 B2 234.336751
4 A3 306.573405
5 A4 306.573405
6 B3 -25.203288
7 A5 -82.736654
8 B4 -154.973307
9 A6 -212.506673
10 A7 -212.506673
formatted list image above here
From the list above, I need to get the (min) negative label for one use case (a) and the (min) positive label for use case (b).
if use case == 'a': script something to return "B3" if use case == 'b': script something to return "A1"
Apologies in advance for my primitive linguistics, I'm trying my best. Was told to try idxmin() - ha way over my head. Any guidance would be HUGE for me. Thank you!