-
-
Save faizankshaikh/84a71e213306980ec6f75dc9e3e709dd to your computer and use it in GitHub Desktop.
Great example.. practical linear programming application
Also, I second the pandas misspelling
Thank you
Great example.. practical linear programming application
Thanks for sharing and in #Create optimization Function, the code should be modified as follows.
Create optimization Function
total_views = ' '
for rownum, row in data.iterrows():
for i, talk in enumerate(decision_variables):
if rownum == i:
formula = row['views'] * talk
total_views += formula
prob += total_views
print('Optimization function: ' + str(total_views))
Very nice code and idea. Thank you for sharing. I used pulp.LpAffineExpression and dictionaries to define the objective function and constraint equations, it worked well.
I should also mention that one would get a different list with and without rounding. I guess this is because of the rounding process.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi !!!!
A wonderful application of linear programming.
Thanks!!!
I believe that the third line should be:
import pandas as pd
instead of:
import padnas as pd
Best regards,
Gabriel