Академический Документы
Профессиональный Документы
Культура Документы
Log In Sign Up
Mathematica
Questions
Tags
Users
Badges
Unanswered
Ask Question
_ Mathematica Stack Exchange is a question and answer site for users of Wolfram
Mathematica. Join them; it only takes a minute:
Sign up
Here's how it works:
Anybody can ask a question Anybody can answer The best answers are voted up and
rise to the top
Merging one element into a two-element list
up vote
5
down vote
favorite
I am trying to find how can do this really quick:
{{a,b,c},{d,e,f},{g,h,i}}
Looks like simple but it takes me plenty of time to think... sorry if this one has
been asked before, I didn't find any answer yet.
list-manipulation
shareimprove this question
edited yesterday
kglr
124k6138303
asked yesterday
leon365
385
Yes, that's a typo, thanks for pointing it out! leon365 14 hours ago
add a comment
4 Answers
active oldest votes
up vote
11
down vote
Also:
kglr
124k6138303
1
Out of these 3 methods, I'm guessing that ArrayReshape would be the most efficient,
right? Sjoerd Smit 17 hours ago
Stephen Wilkus
1065
yes, the pattern is consistent. Thanks for your help, this is work! leon365
yesterday
1
Partition[Flatten[list], 3] is enogh yode 19 hours ago
add a comment
up vote
5
down vote
BlockMap[Flatten, list, 2]
Of course, the BlockMap also can be Developer`PartitionMap
yode
8,86922189
This should be the most concise one. Alexander Zeng 19 hours ago
Step by step
Cases[list, _List]
List /@ Complement[list, %]
Join[%%, %, 2]
give respectively
Alexander Zeng
540213
Sign up or log in
Post as a guest
Name
Not the answer you're looking for? Browse other questions tagged list-manipulation
or ask your own question.
asked
yesterday
viewed
338 times
active
today
BLOG
How Were Designing Channels
Animated Mathematica functions
8 votes comment stats
Related
15
MapThread with non-rectangular lists
0
How do I perform the riffle function backward?
5
Why SetDelayed won't work
1
Sort rows in a matrix with a vector
0
Delete row which contains specifc elements
2
General way to permute rows in a matrix (tensor)
2
list of items and group of alternative items
0
Evaluate in Manipulate
6
Elegant way for element-wise application of a list of functions
0
Print to video permutations
Hot Network Questions
Tour
Help
Chat
Contact
Feedback
Mobile
COMPANY
Stack Overflow
Stack Overflow Business
Developer Jobs
About
Press
Legal
Privacy Policy
STACK EXCHANGE
NETWORK
Technology
Life / Arts
Culture / Recreation
Science
Other
Blog Facebook Twitter LinkedIn
site design / logo 2017 Stack Exchange Inc; user contributions licensed under cc
by-sa 3.0 with attribution required. rev 2017.12.5.28025
Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is
used herein with the limited permission of Wolfram Research, Stack Exchange and
this site disclaim all affiliation therewith.