Skip to content

Instantly share code, notes, and snippets.

@bartekpacia
Created December 29, 2019 15:21
Show Gist options
  • Save bartekpacia/38b4fc4684f1a695eade4f59d2b61883 to your computer and use it in GitHub Desktop.
Save bartekpacia/38b4fc4684f1a695eade4f59d2b61883 to your computer and use it in GitHub Desktop.
idk whats its purpose
import pandas as pd
# asking for team1
list = pd.ExcelFile('M25_list.xlsx')
tlist = pd.read_excel(list, 'teamlist')
print("Here is a list of teams")
for teamlist in tlist['short']:
print(teamlist)
while True:
try:
teamnumber = int(input('Enter team id: '))
if teamnumber < 0 or teamnumber > 31:
raise ValueError
break
print(tlist)
print(type(tlist))
for index, row in tlist.iterrows():
print("----")
print(f"{type(index)} index: {index}")
print(f"{type(row)} row: {row}")
print(f"row name: {row.name}")
print(f"row values: {row.values.tolist()}")
if row[0] == teamnumber:
print("--------")
print(f"index: {index}")
except ValueError:
print("Please enter a number between 1 and 30, stop trying to break the program im trying my best")
# except:
# print("Something went horribly wrong")
tl1 = pd.read_excel(list, 'Orioles')
tl2 = pd.read_excel(list, 'Red Sox')
tl3 = pd.read_excel(list, 'Blue Jays')
#xls = pd.ExcelFile('M25_t1.xlsx')
#df1 = pd.read_excel(xls, 'BAL')
#df2 = pd.read_excel(xls, 'TOR')
# print(df.head())
# for v in df2['id1']:
# print(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment