If it's showing up as a date in Python, that probably means that you opened it up in Excel and then RE-SAVED IT from Excel, which is a problem. (In my opinion, Excel is a dangerous tool for dealing with data sets. It can be helpful to let you view/explore small amounts of data, but you have to be careful because it could be mangling your data in unanticipated ways, so you probably shouldn't save changes!)
You may need to go back to an earlier copy of your raw CSV file that you scraped, or you may need to go back even further and re-scrape the athletic rosters again.
Now, once you get back to where Python is showing heights as "5-6"
, then you need to create a function in Python that does a little string processing.
I'll help get you started, which is a bit tricky because you need to avoid processing the NaN (null) values for all the missing data in the height data column.
def heightStringToInches(hText):
if pd.notnull(hText):
#split the string into feet and inches
footText, inchesText = hText.split('-')
# finally, convert both those strings into numbers
# and do the math, and **return** the correct result
Once you've defined that function, it's a simple matter of calling the apply method on the height column of your data set and providing heightStringToInches as the function that we want to apply (instead of the len function that we did earlier in the example involving varsity letters).