Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profit_extractor.py runs into ParserError for regular trades #71

Open
atiq-cs opened this issue Apr 9, 2022 · 0 comments
Open

profit_extractor.py runs into ParserError for regular trades #71

atiq-cs opened this issue Apr 9, 2022 · 0 comments

Comments

@atiq-cs
Copy link

atiq-cs commented Apr 9, 2022

While the run without --profit works without problems, profit calculation is encountering ParserError every time!

$ python csv-export.py --profit
Username:
Password:
MFA:
Generated device token: 

Pulling trades. Please wait...
0 queued trades and 473 executed trades found in your account.
Choose a filename or press enter to save to `robinhood.csv`:

What is your tax multiplier -default 0.25 (25%) ?
Traceback (most recent call last):
  File "D:\python\robinhood-to-csv\csv-export.py", line 238, in <module>
    profit_csv = profit_extractor(csv, filename)
  File "D:\python\robinhood-to-csv\profit_extractor.py", line 20, in profit_extractor
    handle_raw = pd.read_csv(filename)
  File "D:\python\robinhood-to-csv\env\lib\site-packages\pandas\util\_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "D:\python\robinhood-to-csv\env\lib\site-packages\pandas\io\parsers\readers.py", line 680, in read_csv
    return _read(filepath_or_buffer, kwds)
  File "D:\python\robinhood-to-csv\env\lib\site-packages\pandas\io\parsers\readers.py", line 581, in _read
    return parser.read(nrows)
  File "D:\python\robinhood-to-csv\env\lib\site-packages\pandas\io\parsers\readers.py", line 1254, in read
    index, columns, col_dict = self._engine.read(nrows)
  File "D:\python\robinhood-to-csv\env\lib\site-packages\pandas\io\parsers\c_parser_wrapper.py", line 225, in read
    chunks = self._reader.read_low_memory(nrows)
  File "pandas\_libs\parsers.pyx", line 805, in pandas._libs.parsers.TextReader.read_low_memory
  File "pandas\_libs\parsers.pyx", line 861, in pandas._libs.parsers.TextReader._read_rows
  File "pandas\_libs\parsers.pyx", line 847, in pandas._libs.parsers.TextReader._tokenize_rows
  File "pandas\_libs\parsers.pyx", line 1960, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 55 fields in line 237, saw 57

Python Info

$ python -V
Python 3.10.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant