How to resolve 'KeyError' issue in Pandas dataframe when using a custom function in a loop?
Unable to find out the problem of a defined function that is used in a loop.
The program I am trying to develop, is about a supply chain management that involves planing and managing deliveries and warehouse capacities. I have written a function that is working outside the main code, but when I try to use it in the main procedure, it faces with an error.
Assume that there is a pandas dataframe called df like below:
df =
{'Name': {0: 'a', 1: 'c', 2: 'j', 3: 'd', 4: 'e'},
'Type': {0: 1, 1: 1,...