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.

`flatten` as convinience method for stack all?

See original GitHub issue

There is a bunch of operations that need to be conducted on a 1D array. It could be handy to have a convinience method that mimicks numpys flatten, i.e. works along the lines:

def flatten(dataarray, name='stacked'):
    return dataarray.stack(**{name: dataarray.dims})

What do you think?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
dcheriancommented, Mar 25, 2020

Solved by .stack=[...]?

0reactions
mathausecommented, Mar 25, 2020

Yes indeed, good catch.

Closed by #3826

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to flatten an array that is 700 000 entries long ...
OP here, My theory about reduce being a 'convenience loop function' was right, which was quite clear tbh. This is processed within a...
Read more >
Flatten Binary Tree to Linked List - Topcoder
In this approach, we are going to use post-order traversal where we visit left, right, and then the root. This is very convenient...
Read more >
ndarray.flatten() function | NumPy.matrix.flatten - Initial Commit
Let's say you are working with a stack represented as an array. The "order" parameter only takes four options as its value: 'C',...
Read more >
How to Flatten Array of Arrays of the highest order in a simple ...
I have a matrix of matrices, given in the following code. I want to flatten the array... ... is not convenient. ... –...
Read more >
How to Flatten a Dictionary in Python in 4 Different Ways
For each method I'll point out the pros and cons, and I'll give a quick performance analysis. For this tutorial, I ran all...
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