8000 np.concatenate([ [], [1] ]) converts integer to float · Issue #8878 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

np.concatenate([ [], [1] ]) converts integer to float #8878

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

Closed
Muxas opened this issue Mar 31, 2017 · 1 comment
Closed

np.concatenate([ [], [1] ]) converts integer to float #8878

Muxas opened this issue Mar 31, 2017 · 1 comment

Comments

@Muxas
Copy link
Muxas commented Mar 31, 2017

When concatenating empty list with a list of INTEGERS result is an array of FLOATS. Since numpy 1.12 you can not use floats (result of such concatenation) for indexing without additional convertion from float to integer.

Following example works in numpy <=1.11 and does not work in numpy >= 1.12:

array = np.arange(3)
ind0 = []
ind1 = [1]
total_ind = np.concatenate([ind0, ind1])
print array[total_ind]
@jaimefrio
Copy link
Member
jaimefrio commented Mar 31, 2017

Closing because this is a duplicate of #1586. There's #7450 that would fix it, but we never got around to merge it...

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

2 participants
0