Я пользуюсь пандами. Я скачал набор данных для взрослых и преобразовал его в CSV-файл. Теперь я пытаюсь прочитать CSV-файл с помощью функции read_csv, но получаю следующую ошибку:
sre_constants.error: nothing to repeat at position 0
Вот строка из моего кода, где происходит ошибка-
adult_df = pd.read_csv('E:/iris dataset/adultdata.csv',header=None,
delimiter='*,*', engine='python')
print(adult_df.isnull().sum())
вот трассировка-
C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sklearn\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "E:\iris dataset\naive_bayes_adult_dataset.py", line 9, in <module>
adult_df = pd.read_csv('E:/iris dataset/adultdata.csv',header=None, delimiter='*,*', engine='python')
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 678, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 440, in _read
parser = TextFileReader(filepath_or_buffer, **kwds)
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 787, in __init__
self._make_engine(self.engine)
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 1024, in _make_engine
self._engine = klass(self.f, **self.options)
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 2089, in __init__
self.columns, self.num_original_columns = self._infer_columns()
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 2455, in _infer_columns
line = self._buffered_line()
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 2530, in _buffered_line
return self._next_line()
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 2635, in _next_line
orig_line = self._next_iter_line(row_num=self.pos + 1)
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 2695, in _next_iter_line
return next(self.data)
File "C:\Users\Sharanya\AppData\Roaming\Python\Python36\site-packages\pandas\io\parsers.py", line 2229, in _read
pat = re.compile(sep)
File "C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 233, in compile
return _compile(pattern, flags)
File "C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 301, in _compile
p = sre_compile.compile(pattern, flags)
File "C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\sre_compile.py", line 562, in compile
p = sre_parse.parse(p, flags)
File "C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 855, in parse
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 416, in _parse_sub
not nested and not items))
File "C:\Users\Sharanya\AppData\Local\Programs\Python\Python36-32\lib\sre_parse.py", line 616, in _parse
source.tell() - here + len(this))
sre_constants.error: nothing to repeat at position 0