Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Code mentioned in installation instruction is of older Python version. #160

Open
amirsultan opened this issue Dec 27, 2020 · 0 comments
Open

Comments

@amirsultan
Copy link

Updated code as per Python version 3

from planout.experiment import SimpleExperiment
from planout.ops.random import *

class FirstExperiment(SimpleExperiment):
def assign(self, params, userid):
params.button_color = UniformChoice(choices=['#ff0000', '#00ff00'], unit=userid)
params.button_text = WeightedChoice(
choices=['Join now!', 'Sign up.'],
weights=[0.3, 0.7], unit=userid)

my_exp = FirstExperiment(userid=12)

parameters may be accessed via the . operator

print(my_exp.get('button_text'), my_exp.get('button_color'))

experiment objects include all input data

for i in range(6):
print(FirstExperiment(userid=i))

@amirsultan amirsultan changed the title Code mentioned in installation instruction is on Python version. Code mentioned in installation instruction is of older version Python version. Dec 28, 2020
@amirsultan amirsultan changed the title Code mentioned in installation instruction is of older version Python version. Code mentioned in installation instruction is of older Python version. Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant