Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gabrielawad

This comment has been minimized.

Copy link

@gabrielawad gabrielawad commented Oct 9, 2017

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

@akshithrk

This comment has been minimized.

Copy link

@akshithrk akshithrk commented Dec 3, 2017

Great example.. practical linear programming application
Also, I second the pandas misspelling

@nanduni-nin

This comment has been minimized.

Copy link

@nanduni-nin nanduni-nin commented Jul 5, 2018

Thank you

@Pradeepy16k

This comment has been minimized.

Copy link

@Pradeepy16k Pradeepy16k commented Jul 9, 2018

Great example.. practical linear programming application

@krlakshmikanth

This comment has been minimized.

Copy link

@krlakshmikanth krlakshmikanth commented Nov 8, 2018

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))

@selmayildirim

This comment has been minimized.

Copy link

@selmayildirim selmayildirim commented Nov 24, 2018

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