question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

misleading error message when using ```hstack```

See original GitHub issue
a = np.random.rand(10, 2)
b = np.random.rand(10, 2)
b = csc_matrix(b)
np.hstack((a, b))

ValueError: all the input arrays must have same number of dimensions

I think it should raise like ‘cannot stack sparse matrix’?

Thanks,

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xuewei4dcommented, Jun 29, 2016

@saullocastro My point is that the error message is not correct

0reactions
sebergcommented, Jun 29, 2016

Right, making dtype=object forced if you want an object array… Or maybe an allow_object argument, I am not sure if we even hashed out the details quite. But yes, I think any thought out proposal will be merged quickly 😉.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when using vstack / hstack vs. concatenate · Issue #91
Hi guys, I am seeing errors when using vstack / hstack vs. using concatenate to assemble matrices. The below code block reproduces this....
Read more >
Errors when trying to use hstack in python
I would like to know what is the cause of my errors when I try to use hstack. I have tried many different...
Read more >
HSTACK function
Horizontally appends three arrays in sequence so that the results are one array of three rows and six columns with a #N/A error...
Read more >
Xcode shows error on wrong line | Apple Developer Forums
I have this code in my SwiftUI view struct. HStack{ Text("Direction") Spacer() Picker("Direction", selection: $selectorIndex) { ForEach(0 .
Read more >
pandas.concat — pandas 1.5.2 documentation
How to handle indexes on other axis (or axes). ignore_indexbool, default False. If True, do not use the index values along the concatenation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found