Comments (5)
If it's juypter notebook in ananconda, then put these lines at the top to fix that.
import nest_asyncio
nest_asyncio.apply()
from understat.
ran the following code:
async def main():
async with aiohttp.ClientSession() as session:
understat = Understat(session)
player = await understat.get_league_players(
"epl", 2018,
player_name="Paul Pogba",
team_title="Manchester United"
)
print(json.dumps(player))
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
got the following message:
RuntimeError Traceback (most recent call last)
in
10
11 loop = asyncio.get_event_loop()
---> 12 loop.run_until_complete(main())
~/anaconda3/lib/python3.7/asyncio/base_events.py in run_until_complete(self, future)
569 future.add_done_callback(_run_until_complete_cb)
570 try:
--> 571 self.run_forever()
572 except:
573 if new_task and future.done() and not future.cancelled():
~/anaconda3/lib/python3.7/asyncio/base_events.py in run_forever(self)
524 self._check_closed()
525 if self.is_running():
--> 526 raise RuntimeError('This event loop is already running')
527 if events._get_running_loop() is not None:
528 raise RuntimeError(
RuntimeError: This event loop is already running
[{"id": "1740", "player_name": "Paul Pogba", "games": "35", "time": "3013", "goals": "13", "xG": "15.87753972876817", "assists": "9", "xA": "5.186745170503855", "shots": "105", "key_passes": "55", "yellow_cards": "6", "red_cards": "0", "position": "M S", "team_title": "Manchester United", "npg": "6", "npxG": "8.265851370058954", "xGChain": "21.12592289596796", "xGBuildup": "11.593518570065498"}]
from understat.
Did you figure it out?
from understat.
from understat.
from understat.
Related Issues (16)
- Pulling Match Events Other Than Goals HOT 4
- Apply filters on tables HOT 1
- run time error HOT 5
- Pull additional data for each match HOT 5
- UnboundLocalError
- Possible to filter get_team_players result by date/game week? HOT 1
- feat: Building Conda Packages
- ci: Create Basic CI/CD pipeline using Github Actions
- 'NoneType' object has no attribute 'group' HOT 5
- Example in the readme is not working HOT 1
- Possible issue on Anaconda HOT 4
- Fixtures not working? HOT 1
- Replace BeautifulSoup with lxml or similar
- Tests don't all pass off-season HOT 1
- Only last week HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from understat.