Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- # Creating a simple dictionary to start the values
- vals = {'2': 1, '3': 1, '4': 1, '5': 1, '6': 1,
- '7': 0, '8': 0, '9': 0, '10': -1, 'J': -1,
- 'Q': -1, 'K': -1, 'A': -1, 'A.': -1}
- # Converting to a DataFrame
- df = pd.DataFrame(vals, index=[0])
- # Adding in values to each row in the DF
- df.loc[len(df), :] = [0,1,1,1,1,0,0,0,-1,-1,-1,-1,0,0]
- df.loc[len(df), :] = [1,1,2,2,1,1,0,0,-2,-2,-2,-2,0,0]
- df.loc[len(df), :] = [1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1]
- df.loc[len(df), :] = [1,1,2,2,2,1,0,-1,-2,-2,-2,-2,0,0]
- df.loc[len(df), :] = [1,1,1,1,1,0,0,0,-1,-1,-1,-1,-1,-1]
- df.loc[len(df), :] = [.5,1,1,1.5,1,.5,0,-.5,-1,-1,-1,-1,-1,-1]
- df.loc[len(df), :] = [1,1,2,2,2,1,0,0,-2,-2,-2,-2,-1,-1]
- df.loc[len(df), :] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
- # Renaming the index for each row
- df.rename({0: 'Hi-Lo',
- 1: 'Hi-Opt I',
- 2: 'Hi-Opt II',
- 3: 'KO',
- 4: 'Omega II',
- 5: 'Red 7',
- 6: 'Halves',
- 7: 'Zen Count',
- 8: 'No Strategy'}, inplace=True)
- # Pickling the DataFrame for use later on
- df.to_pickle('Card_Counting_Values')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement