Что означает этот код ошибки? (см. первый ответ для кода ошибки) Я получил это при попытке открыть файл CSV и прочитать первые 5 строк данных.
C:\Users\torou>python cleandep/py
python: can't open file 'cleandep/py': [Errno 2] No such file or directory
C:\Users\torou>python http://cleandep.py
Traceback (most recent call last):
File "bit_generator.pyx", line 40, in numpy.random.bit_generator
File "C:\Users\torou\AppData\Local\Programs\Python\Python37-2\lib\http://secrets.py", line 20, in <module>
from random import SystemRandom
File "C:\Users\torou\http://random.py", line 1, in <module>
from random import random
ImportError: cannot import name 'random' from 'random' C:\Users\torou\http://random.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "http://cleandep.py", line 8, in <module>
import numpy as npy
File "C:\Users\torou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\numpy\__init__.py", line 150, in <module>
from . import random
File "C:\Users\torou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\numpy\random\__init__.py", line 181, in <module>
from . import _pickle
File "C:\Users\torou\AppData\Local\Programs\Python\Python37-32\lib\site-packages\numpy\random\_pickle.py", line 1, in <module>
from .mtrand import RandomState
File "mtrand.pyx", line 9, in init numpy.random.mtrand
File "mt19937.pyx", line 1, in init numpy.random.mt19937
File "bit_generator.pyx", line 43, in init numpy.random.bit_generator
File "C:\Users\torou\http://random.py", line 1, in <module>
from random import random
ImportError: cannot import name 'random' from 'random' C:\Users\torou\http://random.py)
Это код Python 3, который я пытался запустить:
import numpy as npy
import pandas as pd
data= pd.read_csv("cti-april02-log")
data.head()