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

TypeError: ord() expected string of length #14

Open
chenxinye opened this issue Mar 18, 2020 · 0 comments
Open

TypeError: ord() expected string of length #14

chenxinye opened this issue Mar 18, 2020 · 0 comments

Comments

@chenxinye
Copy link
Member

chenxinye commented Mar 18, 2020

It is found that code with the problem:

ts = np.sin(7np.linspace(0,41.8*np.pi,2400))
ts = np.array(ts)
ts -= np.median(ts)
ts *= len(ts)/norm(ts,1)

TOL = .333
abba = ABBA.ABBA(tol=TOL, norm=1);
pieces = abba.compress(ts)
polyg = abba.inverse_compress(ts[0], pieces)
polyg = np.array(polyg)

string, centers = abba.digitize_incremental(pieces)
print('Polygon now represented by the string', string) # output: " Polygon now represented by the string [0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2]"

approx = abba.inverse_transform(string, centers, ts[0]) # TypeError: ord() expected string of length 1, but int found

@chenxinye chenxinye reopened this Mar 22, 2020
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