def stats():

    import pandas as pd
# Load the CSV file into a Pandas DataFrame
    df = pd.read_csv('nba_player_stats.csv')

    print(df)
     RANK               NAME TEAM  POS   AGE  GP   MPG  USG%    TO%  FTA  ...  \
0       1       Devin Booker  Pho    G  26.5  10  42.3  29.5   11.6   63  ...   
1       2      Kawhi Leonard  Lac    F  31.9   2  40.2  30.0   11.9   17  ...   
2       3       Jimmy Butler  Mia    F  33.7   9  38.9  30.6    9.7   90  ...   
3       4    Anthony Edwards  Min    G  21.8   5  39.7  32.4    6.5   39  ...   
4       5       Nikola Jokic  Den    C  28.2  10  37.8  33.4   14.1   69  ...   
..    ...                ...  ...  ...   ...  ..   ...   ...    ...  ...  ...   
211   212      Edmond Sumner  Bro    G  27.4   1   4.5   0.0    NaN    0  ...   
212   213     Omer Yurtseven  Mia    C  24.9   2   2.2  10.2  100.0    0  ...   
213   214     Dewayne Dedmon  Phi    C  33.7   1   5.0  18.5   50.0    0  ...   
214   215  Justin Champagnie  Bos  G-F  21.9   1   5.0  18.0    0.0    0  ...   
215   216    DaQuan Jeffries  Nyk  G-F  25.7   2   2.3   0.0    NaN    0  ...   

     APG  SPG  BPG  TPG   P+R   P+A  P+R+A    VI   ORtg   DRtg  
0    7.1  1.8  0.8  3.0  41.1  43.0   48.2  10.4  132.4  109.9  
1    6.0  2.0  0.5  3.0  41.0  40.5   47.0  11.0  129.4  110.8  
2    5.6  1.9  0.9  2.2  38.3  37.4   43.9  10.8  128.1  110.3  
3    5.2  1.8  2.0  1.6  36.6  36.8   41.8   9.4  122.1  111.0  
4    9.5  0.9  0.7  3.6  43.7  40.1   53.2  16.5  125.7  106.0  
..   ...  ...  ...  ...   ...   ...    ...   ...    ...    ...  
211  1.0  0.0  0.0  0.0   0.0   1.0    1.0   0.0    NaN  125.1  
212  0.5  0.0  0.0  0.5   0.5   0.5    1.0   0.0    NaN    NaN  
213  0.0  0.0  0.0  1.0   1.0   0.0    1.0   0.0    0.0   94.9  
214  0.0  0.0  0.0  0.0   0.0   0.0    0.0   0.0    0.0   99.0  
215  0.0  0.0  0.0  0.0   0.0   0.0    0.0   0.0    NaN    NaN  

[216 rows x 29 columns]
def display_player(team):

    import pandas as pd

    # Load the CSV file into a Pandas DataFrame
    df = pd.read_csv('nba_player_stats.csv')

    # Filter the DataFrame based on the team
    team_df = df[df['TEAM'] == team]

    if not team_df.empty:
        # Display the players on the specified team
        print(team_df)
    else:
        print("No players found for the specified team.")

# Example usage
display_player('Pho')
     RANK             NAME TEAM  POS   AGE  GP   MPG  USG%   TO%  FTA  ...  \
0       1     Devin Booker  Pho    G  26.5  10  42.3  29.5  11.6   63  ...   
6       7     Kevin Durant  Pho    F  34.6  10  42.9  28.4  14.6   89  ...   
52     53    Deandre Ayton  Pho    C  24.8  10  31.9  18.9  13.3   23  ...   
54     55       Chris Paul  Pho    G  38.0   7  35.7  17.4   7.1    4  ...   
104   105     Torrey Craig  Pho    F  32.4  10  17.0  12.6   6.6    9  ...   
120   121     Jock Landale  Pho    C  27.5   6  13.7  14.0   4.5   10  ...   
126   127    Terrence Ross  Pho  G-F  32.3   5  12.1  15.9   0.0    0  ...   
128   129    Cameron Payne  Pho    G  28.8   6  18.5  14.6  13.5    0  ...   
129   130    Landry Shamet  Pho    G  26.2   9  16.4  11.2   5.5    4  ...   
131   132      Josh Okogie  Pho    G  24.7  10  17.5  11.4   7.4   13  ...   
137   138  Bismack Biyombo  Pho    C  30.7   7  10.1  17.3  28.2   16  ...   
144   145      T.J. Warren  Pho    F  29.7   5  13.0  13.9   5.2    4  ...   
170   171       Damion Lee  Pho  G-F  30.6   7  11.0  10.1   5.7    2  ...   
185   186    Ish Wainright  Pho    F  28.7   5   3.8   9.2   0.0    0  ...   

     APG  SPG  BPG  TPG   P+R   P+A  P+R+A    VI   ORtg   DRtg  
0    7.1  1.8  0.8  3.0  41.1  43.0   48.2  10.4  132.4  109.9  
6    5.6  0.9  1.4  3.5  38.7  35.2   44.3  10.7  116.7  109.8  
52   1.0  0.6  0.7  1.7  23.1  14.4   24.1   6.4  107.4  104.2  
54   7.4  1.7  0.7  1.0  17.4  19.9   24.9   8.6  113.0  110.4  
104  0.6  0.4  0.2  0.3   9.2   7.3    9.8   5.1  143.0  105.6  
120  0.3  0.5  0.3  0.2   8.8   5.3    9.2   5.2  132.9  102.0  
126  0.2  0.2  0.4  0.0   5.8   4.6    6.0   3.5  104.9  110.3  
128  3.0  0.5  0.2  0.8   5.7   7.3    8.7   5.5   93.9  108.1  
129  0.8  0.2  0.1  0.2   5.6   5.1    6.3   3.9  115.1  112.4  
131  1.3  0.6  0.2  0.3   6.2   5.4    7.5   5.1  118.1  109.0  
137  0.9  0.0  1.3  0.9   7.1   4.4    8.0   9.0  110.7   91.4  
144  0.6  0.2  0.6  0.2   4.2   3.8    4.8   3.8   94.8  114.9  
170  0.7  0.1  0.0  0.1   3.0   2.3    3.7   4.2   94.0  109.4  
185  0.0  0.0  0.2  0.0   0.8   0.6    0.8   0.0    NaN    NaN  

[14 rows x 29 columns]
import pandas as pd
# Load the CSV file into a Pandas DataFrame
df = pd.read_csv('nba_player_stats.csv')
# Filter the DataFrame to only include stats for a specific player (in this case, Jimmy Butler)
player_name = 'Jimmy Butler'
player_stats = df[df['NAME'] == player_name]
# Display the stats for the player
print(f"\nStats for {player_name}:")
print(player_stats[['PPG', 'RPG', 'APG', 'AGE']])
Stats for Jimmy Butler:
    PPG  RPG  APG   AGE
2  31.9  6.4  5.6  33.7
import pandas as pd

# Load the CSV file into a Pandas DataFrame
df = pd.read_csv('nba_player_stats.csv')

# Get the player name from the user
player_name = input("Enter the player's name: ")

# Filter the DataFrame to only include stats for the specified player
player_stats = df[df['NAME'] == player_name]

# Check if the player exists in the DataFrame
if player_stats.empty:
    print("Player not found.")
else:
    # Display the stats for the player
    print(f"\nStats for {player_name}:")
    print(player_stats[['PPG', 'RPG', 'APG', 'AGE']])
Stats for Devin Booker:
    PPG  RPG  APG   AGE
0  35.9  5.2  7.1  26.5
def points():
    import pandas as pd

# Load the CSV file into a Pandas DataFrame
df = pd.read_csv('nba_player_stats.csv')

# Prompt the user to input a player name and points scored
player_name = input("Enter the player's name: ")
points_line = int(input("Enter the players points line: "))

# Filter the DataFrame to only include rows for the input player name
player_stats = df[df['NAME'] == player_name]

# If the input player name is not found, print an error message and exit
if player_stats.empty:
    print("Error: Player not found")
    exit()

# Calculate the player's average points per game
avg_ppg = player_stats['PPG'].mean()

if points_line > avg_ppg:
    print(points_line , ">" , avg_ppg)
else:
    print(points_line, "<" , avg_ppg)

# Compare the input points scored to the player's average points per game
if points_line > avg_ppg:
    print("This is a good under bet")
elif points_line == avg_ppg:
    print("This bet is 50/50")
else:
    print("This is a good over bet")

points()
1 < 31.9
This is a good over bet
def rebounds():

    import pandas as pd

# Load the CSV file into a Pandas DataFrame
df = pd.read_csv('nba_player_stats.csv')

# Prompt the user to input a player name and points scored
player_name = input("Enter the player's name: ")
rebound_line = int(input("Enter the players rebound line: "))

# Filter the DataFrame to only include rows for the input player name
player_stats = df[df['NAME'] == player_name]

# If the input player name is not found, print an error message and exit
if player_stats.empty:
    print("Error: Player not found")
    exit()

# Calculate the player's average points per game
avg_RPG = player_stats['RPG'].mean()

if rebound_line > avg_RPG:
    print(rebound_line , ">" , avg_RPG)
else:
    print(rebound_line, "<" , avg_RPG)

# Compare the input points scored to the player's average points per game
if rebound_line > avg_RPG:
    print("This is a good under bet")
elif rebound_line == avg_RPG:
    print("This bet is 50/50")
else:
    print("This is a good over bet")

rebounds()
1 < 6.4
This is a good over bet
def assists():

    import pandas as pd
# Load the CSV file into a Pandas DataFrame
df = pd.read_csv('nba_player_stats.csv')

# Prompt the user to input a player name and points scored
player_name = input("Enter the player's name: ")
assist_line = int(input("Enter the players assist line: "))

# Filter the DataFrame to only include rows for the input player name
player_stats = df[df['NAME'] == player_name]

# If the input player name is not found, print an error message and exit
if player_stats.empty:
    print("Error: Player not found")
    exit()

# Calculate the player's average points per game
avg_APG = player_stats['APG'].mean()

if assist_line > avg_APG:
    print(assist_line , ">" , avg_APG)
else:
    print(assist_line, "<" , avg_APG)

# Compare the input points scored to the player's average points per game
if assist_line > avg_APG:
    print("This is a good under bet")
elif assist_line == avg_APG:
    print("This bet is 50/50")
else:
    print("This is a good over bet")

assists()
2 < 5.6
This is a good over bet
def process():

    stats = input("stats, points, rebounds, and assists")

    if stats == "stats":
        import pandas as pd
        # Load the CSV file into a Pandas DataFrame
        df = pd.read_csv('nba_player_stats.csv')
        print(df)
    elif stats == "points":
        def points():
            import pandas as pd

# Load the CSV file into a Pandas DataFrame
            df = pd.read_csv('nba_player_stats.csv')

# Prompt the user to input a player name and points scored
            player_name = input("Enter the player's name: ")
            points_line = int(input("Enter the players points line: "))

# Filter the DataFrame to only include rows for the input player name
            player_stats = df[df['NAME'] == player_name]

# If the input player name is not found, print an error message and exit
            if player_stats.empty:
                print("Error: Player not found")
                exit()

# Calculate the player's average points per game
            avg_ppg = player_stats['PPG'].mean()

            if points_line > avg_ppg:
                print(points_line , ">" , avg_ppg)
            else:
               print(points_line, "<" , avg_ppg)

# Compare the input points scored to the player's average points per game
            if points_line > avg_ppg:
                print("This is a good under bet")
            elif points_line == avg_ppg:
               print("This bet is 50/50")
            else:
                 print("This is a good over bet")

        points()
    elif stats == "rebounds":
        def rebounds():
            import pandas as pd
# Load the CSV file into a Pandas DataFrame
            df = pd.read_csv('nba_player_stats.csv')

# Prompt the user to input a player name and points scored
            player_name = input("Enter the player's name: ")
            rebound_line = int(input("Enter the players rebound line: "))

# Filter the DataFrame to only include rows for the input player name
            player_stats = df[df['NAME'] == player_name]

# If the input player name is not found, print an error message and exit
            if player_stats.empty:
              print("Error: Player not found")
              exit()

# Calculate the player's average points per game
            avg_RPG = player_stats['RPG'].mean()

            if rebound_line > avg_RPG:
              print(rebound_line , ">" , avg_RPG)
            else:
                print(rebound_line, "<" , avg_RPG)

# Compare the input points scored to the player's average points per game
            if rebound_line > avg_RPG:
                print("This is a good under bet")
            elif rebound_line == avg_RPG:
                print("This bet is 50/50")
            else:
                print("This is a good over bet")

        rebounds()
    elif stats == "assists":
        def assists():
            import pandas as pd
        # Load the CSV file into a Pandas DataFrame
            df = pd.read_csv('nba_player_stats.csv')

# Prompt the user to input a player name and points scored
            player_name = input("Enter the player's name: ")
            assist_line = int(input("Enter the players assist line: "))

# Filter the DataFrame to only include rows for the input player name
            player_stats = df[df['NAME'] == player_name]

# If the input player name is not found, print an error message and exit
            if player_stats.empty:
               print("Error: Player not found")
               exit()
 
# Calculate the player's average points per game
            avg_APG = player_stats['APG'].mean()

            if assist_line > avg_APG:
               print(assist_line , ">" , avg_APG)
            else:
               print(assist_line, "<" , avg_APG)

# Compare the input points scored to the player's average points per game
            if assist_line > avg_APG:
                print("This is a good under bet")
            elif assist_line == avg_APG:
               print("This bet is 50/50")
            else:
                print("This is a good over bet")

        assists()
    else:
        print("Invalid option")

process()
     RANK               NAME TEAM  POS   AGE  GP   MPG  USG%    TO%  FTA  ...  \
0       1       Devin Booker  Pho    G  26.5  10  42.3  29.5   11.6   63  ...   
1       2      Kawhi Leonard  Lac    F  31.9   2  40.2  30.0   11.9   17  ...   
2       3       Jimmy Butler  Mia    F  33.7   9  38.9  30.6    9.7   90  ...   
3       4    Anthony Edwards  Min    G  21.8   5  39.7  32.4    6.5   39  ...   
4       5       Nikola Jokic  Den    C  28.2  10  37.8  33.4   14.1   69  ...   
..    ...                ...  ...  ...   ...  ..   ...   ...    ...  ...  ...   
211   212      Edmond Sumner  Bro    G  27.4   1   4.5   0.0    NaN    0  ...   
212   213     Omer Yurtseven  Mia    C  24.9   2   2.2  10.2  100.0    0  ...   
213   214     Dewayne Dedmon  Phi    C  33.7   1   5.0  18.5   50.0    0  ...   
214   215  Justin Champagnie  Bos  G-F  21.9   1   5.0  18.0    0.0    0  ...   
215   216    DaQuan Jeffries  Nyk  G-F  25.7   2   2.3   0.0    NaN    0  ...   

     APG  SPG  BPG  TPG   P+R   P+A  P+R+A    VI   ORtg   DRtg  
0    7.1  1.8  0.8  3.0  41.1  43.0   48.2  10.4  132.4  109.9  
1    6.0  2.0  0.5  3.0  41.0  40.5   47.0  11.0  129.4  110.8  
2    5.6  1.9  0.9  2.2  38.3  37.4   43.9  10.8  128.1  110.3  
3    5.2  1.8  2.0  1.6  36.6  36.8   41.8   9.4  122.1  111.0  
4    9.5  0.9  0.7  3.6  43.7  40.1   53.2  16.5  125.7  106.0  
..   ...  ...  ...  ...   ...   ...    ...   ...    ...    ...  
211  1.0  0.0  0.0  0.0   0.0   1.0    1.0   0.0    NaN  125.1  
212  0.5  0.0  0.0  0.5   0.5   0.5    1.0   0.0    NaN    NaN  
213  0.0  0.0  0.0  1.0   1.0   0.0    1.0   0.0    0.0   94.9  
214  0.0  0.0  0.0  0.0   0.0   0.0    0.0   0.0    0.0   99.0  
215  0.0  0.0  0.0  0.0   0.0   0.0    0.0   0.0    NaN    NaN  

[216 rows x 29 columns]
import requests

url = "http://127.0.0.1:8067/playerList"

payload = "<file contents here>"
headers = {
  'Content-Type': 'text/plain'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
[
    {
        "id": 1,
        "SOG": "4.29",
        "Min": "22.4",
        "Points": "1.87",
        "Name": "Connor McDavid"
    },
    {
        "id": 2,
        "SOG": "3.09",
        "Min": "21.7",
        "Points": "1.60",
        "Name": "Leon Draisaitl"
    },
    {
        "id": 3,
        "SOG": "4.8",
        "Min": "19.5",
        "Points": "1.38",
        "Name": "David Pastrnak"
    },
    {
        "id": 4,
        "SOG": "5.06",
        "Min": "22.3",
        "Points": "1.56",
        "Name": "Nathan MacKinnon"
    },
    {
        "id": 5,
        "SOG": "3.82",
        "Min": "18.8",
        "Points": "1.33",
        "Name": "Jason Robertson"
    },
    {
        "id": 6,
        "SOG": "2.87",
        "Min": "19.7",
        "Points": "1.16",
        "Name": "Brayden Point"
    },
    {
        "id": 7,
        "SOG": "2.49",
        "Min": "19.6",
        "Points": "1.12",
        "Name": "Artemi Panarin"
    },
    {
        "id": 8,
        "SOG": "2.78",
        "Min": "25.6",
        "Points": "1.23",
        "Name": "Erik Karlsson"
    },
    {
        "id": 9,
        "SOG": "2.28",
        "Min": "18.5",
        "Points": "1.43",
        "Name": "Brad Marchand"
    },
    {
        "id": 10,
        "SOG": "3.57",
        "Min": "18.5",
        "Points": "1.06",
        "Name": "William Nylander"
    },
    {
        "id": 11,
        "SOG": "4.29",
        "Min": "22.4",
        "Points": "1.87",
        "Name": "Connor McDavid"
    },
    {
        "id": 12,
        "SOG": "3.09",
        "Min": "21.7",
        "Points": "1.60",
        "Name": "Leon Draisaitl"
    },
    {
        "id": 13,
        "SOG": "4.8",
        "Min": "19.5",
        "Points": "1.38",
        "Name": "David Pastrnak"
    },
    {
        "id": 14,
        "SOG": "5.06",
        "Min": "22.3",
        "Points": "1.56",
        "Name": "Nathan MacKinnon"
    },
    {
        "id": 15,
        "SOG": "3.82",
        "Min": "18.8",
        "Points": "1.33",
        "Name": "Jason Robertson"
    },
    {
        "id": 16,
        "SOG": "2.87",
        "Min": "19.7",
        "Points": "1.16",
        "Name": "Brayden Point"
    },
    {
        "id": 17,
        "SOG": "2.49",
        "Min": "19.6",
        "Points": "1.12",
        "Name": "Artemi Panarin"
    },
    {
        "id": 18,
        "SOG": "2.78",
        "Min": "25.6",
        "Points": "1.23",
        "Name": "Erik Karlsson"
    },
    {
        "id": 19,
        "SOG": "2.28",
        "Min": "18.5",
        "Points": "1.43",
        "Name": "Brad Marchand"
    },
    {
        "id": 20,
        "SOG": "3.57",
        "Min": "18.5",
        "Points": "1.06",
        "Name": "William Nylander"
    },
    {
        "id": 21,
        "SOG": "4.29",
        "Min": "22.4",
        "Points": "1.87",
        "Name": "Connor McDavid"
    },
    {
        "id": 22,
        "SOG": "3.09",
        "Min": "21.7",
        "Points": "1.60",
        "Name": "Leon Draisaitl"
    },
    {
        "id": 23,
        "SOG": "4.8",
        "Min": "19.5",
        "Points": "1.38",
        "Name": "David Pastrnak"
    },
    {
        "id": 24,
        "SOG": "5.06",
        "Min": "22.3",
        "Points": "1.56",
        "Name": "Nathan MacKinnon"
    },
    {
        "id": 25,
        "SOG": "3.82",
        "Min": "18.8",
        "Points": "1.33",
        "Name": "Jason Robertson"
    },
    {
        "id": 26,
        "SOG": "2.87",
        "Min": "19.7",
        "Points": "1.16",
        "Name": "Brayden Point"
    },
    {
        "id": 27,
        "SOG": "2.49",
        "Min": "19.6",
        "Points": "1.12",
        "Name": "Artemi Panarin"
    },
    {
        "id": 28,
        "SOG": "2.78",
        "Min": "25.6",
        "Points": "1.23",
        "Name": "Erik Karlsson"
    },
    {
        "id": 29,
        "SOG": "2.28",
        "Min": "18.5",
        "Points": "1.43",
        "Name": "Brad Marchand"
    },
    {
        "id": 30,
        "SOG": "3.57",
        "Min": "18.5",
        "Points": "1.06",
        "Name": "William Nylander"
    }
]