jbholden / cdcpool_google

0 stars 1 forks source link

Player with less than 10 picks in excel spreadsheet? #16

Closed jbholden closed 10 years ago

jbholden commented 10 years ago

In issue #7, the following assumption was made:

In the excel spreadsheet for 2013, week number 6, Dale R appears to not have a pick entered for the game Arizona State vs. Notre Dame game (both cells appear blank). Do you see the same thing and doesn't this violate the above assumptions? I am using Apple numbers to look at this spreadsheet.

jbholden commented 10 years ago

The "Participants w/o valid picks entered:" row in the excel spreadsheet has Dale's picks as invalid. I thought this might be a thursday night game but it was on Saturday Oct. 5.

blreams commented 10 years ago

That one is a little weird. When I look at it in Excel, I see a valid pick for Game 6 (he picked Arizona State over Notre Dame). If you look at row 35 of the spreadsheet, I keep a count of all the cells in each column that have something (anything). That way I can easily spot if someone missed a game or inadvertently picked both teams in a game. Cell BB35 shows "10" meaning Dale has 10 cells with picks. Also (in Excel), once scores have been entered, I use a conditional format to color correct and incorrect picks (light green is correct, pinkish red is incorrect). That game shows a pinkish red for Arizona State in Dale's column (meaning the spreadsheet thought he picked Arizona State and got it wrong).

Now, here is the weird part. If I click on that cell and click on the formula bar to put the cursor on whatever text is in that cell, it appears as if there is no text. And if I click away from the formula bar, whatever value is in that cell disappears and it looks as if the cell contains nothing. So, I went back to Dale's original pick sheet and what I found was that Dale put a single quote character in that cell (which is special for Excel...it tells it that you are going to enter a string value in the cell). Weird huh?

jbholden commented 10 years ago

I believe I have a some code that will work correctly. I have been using the xlrd module found here to read the excel file (http://www.python-excel.org). Instead of looking at the cell contents to determine if it is blank or not, I look at the cell type. If the cell type is equal to cell empty (value of 0) then this game was not picked.

CELL_EMPTY = 0
team1_picked = sheet.cell_type(team1_row,player_column) != CELL_EMPTY
team2_picked = sheet.cell_type(team2_row,player_column) != CELL_EMPTY