soccer-stats | Soccer Stats is an example application | Continuous Deployment library
kandi X-RAY | soccer-stats Summary
kandi X-RAY | soccer-stats Summary
Soccer Stats is an example application to be used as a proof of concept for a presentation at Ansible Meetup in São Paulo.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Compares this object to another
- Getter for away away team
- Gets the date
- Get the home team currently selected
- Lists all matches for a team
- Lists all matches for a single team
- Get the index
- Connect to H2 server
- The main application
- Returns a hash code for this region
- Returns a list of match matches for the given home team
- Lists all matches from home team
soccer-stats Key Features
soccer-stats Examples and Code Snippets
Community Discussions
Trending Discussions on soccer-stats
QUESTION
Using: Python in Google Collab
Thanks in Advance:
I have run this code on other data I have scraped FBREF, so I am unsure why it's happening now. The only difference is the way I scraped it.
The first time I scraped it:
url_link = 'https://fbref.com/en/comps/Big5/gca/players/Big-5-European-Leagues-Stats'
The second time I scraped it:
url = 'https://fbref.com/en/comps/22/stats/Major-League-Soccer-Stats'
html_content = requests.get(url).text.replace('', '')
df = pd.read_html(html_content)
I then convert the data from object to float so I can do a calculation, after I have pulled it into my dataframe:
dfstandard['90s'] = dfstandard['90s'].astype(float)
dfstandard['Gls'] = dfstandard['Gls'].astype(float)
I look and it shows they are both floats:
10 90s 743 non-null float64
11 Gls 743 non-null float64
But when I run the code that as worked previously:
dfstandard['Gls'] = dfstandard['Gls'] / dfstandard['90s']
I get the error message "TypeError: '<' not supported between instances of 'str' and 'int'"
I am fairly new to scraping, I'm stuck and don't know what to do next.
The full error message is below:
...ANSWER
Answered 2022-Jan-19 at 18:12There are two Gls
columns in your dataframe. I think you converted only one "Gls"
column to float, and when you do dfstandard['Gls'] = dfstandard['Gls'] / dfstandard['90s']
, the other "Gls" column is getting considered?...
Try stripping whitespace from the column names too
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install soccer-stats
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page