I have a dataset in CSV file and all data is a numeric attribute, I want to apply k-Nearest Neighbors in my dataset 

I have some error in my code I don't know who I can fix it. 

code:
[enter image description here][1]
[enter image description here][2]
['https://Stackoverflow.com/questions/55409656', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/11273598/']
The [`asyncio.run()`](https://docs.python.org/3.7/library/asyncio-task.html#asyncio.run) documentation says:

> 
> This function [cannot](https://github.com/python/cpython/blob/3.8/Lib/asyncio/runners.py#L32-L34) be called when another asyncio event loop is running in the same thread.
> 
> 
> 

In your case, jupyter ([IPython ≥ 7.0](https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7)) is already running an event loop:

> 
> You can now use async/await at the top level in the IPython terminal and in the notebook, it should — in most of the cases — “just work”. Update IPython to version 7+, IPykernel to version 5+, and you’re off to the races.
> 
> 
> 

Therefore you don't need to start the event loop yourself and can instead call `await main(url)` directly, even if your code lies outside any asynchronous function.

**Jupyter / IPython**

```py
async def main():
    print(1)

await main()

```

**Python (≥ 3.7) or older versions of IPython**

```py
import asyncio

async def main():
    print(1)

asyncio.run(main())

```

In your code that would give:

```py
url = ['url1', 'url2']
result = await main(url)

for text in result:
    pass # text contains your html (text) response

```

**Caution**

There is a [slight difference](https://ipython.readthedocs.io/en/stable/interactive/autoawait.html#difference-between-terminal-ipython-and-ipykernel) on how Jupyter uses the loop compared to IPython.
Just use this:

<https://github.com/erdewit/nest_asyncio>

```
import nest_asyncio
nest_asyncio.apply()

```