Message Boards Message Boards

0
|
837 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Extracting sublists from the main list

Posted 2 months ago
POSTED BY: Alex Teymouri
3 Replies
Posted 2 months ago

GatherBy[data, First]

or

GroupBy[data, First]

(I think you're missing an element in your list4.)

POSTED BY: Eric Rimbey
Posted 2 months ago

Thanks, Eric.

That is a great solution way.

POSTED BY: Alex Teymouri
Posted 2 months ago

It may be more convenient to use this form depending on what you want to do next

grouped = GroupBy[data, First -> Last]

E.g.

{Mean@#, Median@#, StandardDeviation@#} & /@ grouped
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract