Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
flossn468yJep, reshaping to (-1,1) was the solution. But it caused some random exception that made it a pain to debug.
-
Numpy does have some docs. I think they assume you'd just loop through your array and make new items that way.
Thanks to their *fantastic* docs, I re-wrote my senior project three times. I didn't notice they'd mirrored the coordinates intentionally. :/ -
@flossn "reshaping to (-1,1)" what the heck does that mean?
and what kind of weird environment is this where you can't just iterate an array? -
@jiraTicket numpy has strange (matlab) syntax and because of the way python handles typing, iterations can get kind of weird if you aren't exactly sure what's going on.
If you explicitly iterate through a whole list, you can really slow things down, too, since you aren't using the bits that are in C, you're using something at native python speed. 'Pythonic' code matters for performance reasons as well as aesthetic ones. -
flossn468y@jiraTicket It basically means reshaping a one dimensional array [a,b,c] to a two dimensional array [[a],[... with a variable sized first axis (-1) and a fixed (in this case one) sized second axis (1)
Related Rants
What I have: [a, b, c]
What I need: [[a],[b],[c]]
No documentation
Just numpy things ¯\_(ツ)_/¯
undefined
numpy
frustration