DimaKudosh / pydfs-lineup-optimizer

Daily Fantasy Sports lineup optimzer for all popular daily fantasy sports sites
MIT License
424 stars 157 forks source link

Question #286

Closed Denwen12 closed 3 years ago

Denwen12 commented 3 years ago

I got a quick Questions @DimaKudosh, my projections for baseball are in negative numbers for better matches.. Anyway to trick the program to use negative numbers?

DimaKudosh commented 3 years ago

It's not clear how it should work, if like with positive projections it is easier to iterate over all players and change projection to a positive value

Denwen12 commented 3 years ago

How can I do that

On Sun, Aug 22, 2021, 3:14 PM Dima Kudosh @.***> wrote:

It's not clear how it should work, if like with positive projections it is easier to iterate over all players and change projection to a positive value

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/286#issuecomment-903317024, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7R6TWBU4TYFAJRTU6LT6FEDHANCNFSM5CSHWE7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

DimaKudosh commented 3 years ago
for player in optimizer.players:
    player.fppg = abs(player.fppg)
Denwen12 commented 3 years ago

Awesome, thanks! , what will happen if I still got positive numbers will they become negative numbers

On Sun, Aug 22, 2021, 4:08 PM Dima Kudosh @.***> wrote:

for player in optimizer.players: player.fppg = abs(player.fppg)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/286#issuecomment-903323726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7SK33YLEHKFMCZXIKLT6FKNTANCNFSM5CSHWE7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Denwen12 commented 3 years ago

I found this @Dima Kudosh @.***>

Methods #2 : Using numpy The Python module, Numpy, can also be used which is the most pythonic way to solve the given problem. The list is first converted to numpy array and then, the negative of the array is returned, which is finally converted to list.

Python3 program to Convert positive

list integers to negative and vice-versa

import numpy as np

def Convert(lst): lst = np.array(lst) return list(-lst)

Driver code

lst = [-1, 2, 3, -4, 5, -6, -7] print(Convert(lst)) Output:

[1, -2, -3, 4, -5, 6, 7]

Can you give me a python code to use that for the fppg column

On Sun, Aug 22, 2021, 11:09 PM joseph offen @.***> wrote:

Awesome, thanks! , what will happen if I still got positive numbers will they become negative numbers

On Sun, Aug 22, 2021, 4:08 PM Dima Kudosh @.***> wrote:

for player in optimizer.players: player.fppg = abs(player.fppg)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/286#issuecomment-903323726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7SK33YLEHKFMCZXIKLT6FKNTANCNFSM5CSHWE7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .