I have a filtered dataframe:
börse2 = bör[(bör['Ausprägung'] == bor)].iloc[0:1, : ]
which in some cases looks like this (empty):
When i run the command:
bor2 = börse2.iloc[0]['Schlüssel']
I get the error:
IndexError: single positional indexer is out-of-bounds
which makes sense, how can I see in this cases that bor2= 111
for example? Is there another option instead of try except. The problem with try except is that there can also be another error, but I want to explicity only use it if my dataframe bor2
is empty.