Skip to content

Type Error when calculating shingles #6

@MikeB2019x

Description

@MikeB2019x

Hi Chris. Nice article on MinHash! The code is throwing the type error below (in Python 3.7.3). Not sure what to do about that as I am new to Python but if you have recommendations or can point me in the right direction it would be appreciated.

$ python runMinHashExample.py
runMinHashExample.py:63: DeprecationWarning: 'U' mode is deprecated
  f = open(truthFile, "rU")
Shingling articles...
runMinHashExample.py:94: DeprecationWarning: 'U' mode is deprecated
  f = open(dataFile, "rU")
Traceback (most recent call last):
  File "runMinHashExample.py", line 127, in <module>
    crc = binascii.crc32(shingle) & 0xffffffff
TypeError: a bytes-like object is required, not 'str'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions