Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. # Creating a simple dictionary to start the values
  4. vals = {'2': 1, '3': 1, '4': 1, '5': 1, '6': 1,
  5. '7': 0, '8': 0, '9': 0, '10': -1, 'J': -1,
  6. 'Q': -1, 'K': -1, 'A': -1, 'A.': -1}
  7.  
  8. # Converting to a DataFrame
  9. df = pd.DataFrame(vals, index=[0])
  10.  
  11. # Adding in values to each row in the DF
  12. df.loc[len(df), :] = [0,1,1,1,1,0,0,0,-1,-1,-1,-1,0,0]
  13. df.loc[len(df), :] = [1,1,2,2,1,1,0,0,-2,-2,-2,-2,0,0]
  14. df.loc[len(df), :] = [1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1]
  15. df.loc[len(df), :] = [1,1,2,2,2,1,0,-1,-2,-2,-2,-2,0,0]
  16. df.loc[len(df), :] = [1,1,1,1,1,0,0,0,-1,-1,-1,-1,-1,-1]
  17. df.loc[len(df), :] = [.5,1,1,1.5,1,.5,0,-.5,-1,-1,-1,-1,-1,-1]
  18. df.loc[len(df), :] = [1,1,2,2,2,1,0,0,-2,-2,-2,-2,-1,-1]
  19. df.loc[len(df), :] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
  20.  
  21. # Renaming the index for each row
  22. df.rename({0: 'Hi-Lo',
  23. 1: 'Hi-Opt I',
  24. 2: 'Hi-Opt II',
  25. 3: 'KO',
  26. 4: 'Omega II',
  27. 5: 'Red 7',
  28. 6: 'Halves',
  29. 7: 'Zen Count',
  30. 8: 'No Strategy'}, inplace=True)
  31.  
  32. # Pickling the DataFrame for use later on
  33. df.to_pickle('Card_Counting_Values')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement