From the list of 3-tuples, how can I select tuples which contain one for more nines? [on hold]Find positions of items in a list based on neighboursHow to delete list items that contain a non-numeric PartSelect out of nested listSelecting list elements depending if they contain sub-list elementsEliminating items from list by ruleSelect UPPER CASE list items with spaces and punctuationSelect sublists that contain $n$ odd numbersDeleting items from a list when they meet certain criteriaSelect data from a listSelect items in a list that contain criteria #2
Ability To Change Root User Password (Vulnerability?)
First sign that you should look for another job?
How can one's career as a reviewer be ended?
Should I refuse being named as co-author of a bad quality paper?
60s or 70s novel about Empire of Man making 1st contact with 1st discovered alien race
Will Roalesk, Apex Hybrid, trigger Sharktocrab twice?
Generate basis elements of the Steenrod algebra
Why was this person allowed to become Grand Maester?
A word that means "blending into a community too much"
Is using 'echo' to display attacker-controlled data on the terminal dangerous?
Which is the better way to call a method that is only available to one class that implements an interface but not the other one?
Single-key teletype?
Advantages of the Exponential Family: why should we study it and use it?
Scientist couple raises alien baby
Why am I getting a strange double quote (“) in Open Office instead of the ordinary one (")?
Live action TV show where High school Kids go into the virtual world and have to clear levels
How to communicate to my GM that not being allowed to use stealth isn't fun for me?
What is this airplane?
What would be the way to say "just saying" in German? (Not the literal translation)
Are polynomials with the same roots identical?
Fermat's statement about the ancients: How serious was he?
Teaching a class likely meant to inflate the GPA of student athletes
What differences exist between adamantine and adamantite in all editions of D&D?
Can a human be transformed into a Mind Flayer?
From the list of 3-tuples, how can I select tuples which contain one for more nines? [on hold]
Find positions of items in a list based on neighboursHow to delete list items that contain a non-numeric PartSelect out of nested listSelecting list elements depending if they contain sub-list elementsEliminating items from list by ruleSelect UPPER CASE list items with spaces and punctuationSelect sublists that contain $n$ odd numbersDeleting items from a list when they meet certain criteriaSelect data from a listSelect items in a list that contain criteria #2
$begingroup$
From the list
Tuples[1, 2, 3, 4, 9, 3]
how can I select exactly those 3-tuples that contain one for more nines?
This is the result I want:
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1 ... 9, 9, 4, 9, 9, 9
list-manipulation
New contributor
$endgroup$
put on hold as off-topic by Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform Jun 3 at 14:23
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform
add a comment |
$begingroup$
From the list
Tuples[1, 2, 3, 4, 9, 3]
how can I select exactly those 3-tuples that contain one for more nines?
This is the result I want:
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1 ... 9, 9, 4, 9, 9, 9
list-manipulation
New contributor
$endgroup$
put on hold as off-topic by Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform Jun 3 at 14:23
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform
2
$begingroup$
Help > Wolfram Docuentation, enter "select" (with or without quotes). First hit is toSelect
...
$endgroup$
– Daniel Lichtblau
Jun 2 at 11:59
add a comment |
$begingroup$
From the list
Tuples[1, 2, 3, 4, 9, 3]
how can I select exactly those 3-tuples that contain one for more nines?
This is the result I want:
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1 ... 9, 9, 4, 9, 9, 9
list-manipulation
New contributor
$endgroup$
From the list
Tuples[1, 2, 3, 4, 9, 3]
how can I select exactly those 3-tuples that contain one for more nines?
This is the result I want:
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1 ... 9, 9, 4, 9, 9, 9
list-manipulation
list-manipulation
New contributor
New contributor
edited Jun 3 at 4:23
m_goldberg
90.5k873203
90.5k873203
New contributor
asked Jun 2 at 7:25
CarbajoCarbajo
683
683
New contributor
New contributor
put on hold as off-topic by Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform Jun 3 at 14:23
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform
put on hold as off-topic by Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform Jun 3 at 14:23
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Daniel Lichtblau, Henrik Schumacher, ciao, user42582, AccidentalFourierTransform
2
$begingroup$
Help > Wolfram Docuentation, enter "select" (with or without quotes). First hit is toSelect
...
$endgroup$
– Daniel Lichtblau
Jun 2 at 11:59
add a comment |
2
$begingroup$
Help > Wolfram Docuentation, enter "select" (with or without quotes). First hit is toSelect
...
$endgroup$
– Daniel Lichtblau
Jun 2 at 11:59
2
2
$begingroup$
Help > Wolfram Docuentation, enter "select" (with or without quotes). First hit is to
Select
...$endgroup$
– Daniel Lichtblau
Jun 2 at 11:59
$begingroup$
Help > Wolfram Docuentation, enter "select" (with or without quotes). First hit is to
Select
...$endgroup$
– Daniel Lichtblau
Jun 2 at 11:59
add a comment |
4 Answers
4
active
oldest
votes
$begingroup$
list=Tuples[1, 2, 3, 4, 9, 3] ;
Cases[___,9,___]@list
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1, 1, 9, 2, 1,
9, 3, 1, 9, 4, 1, 9, 9,
2, 1, 9, 2, 2, 9, 2, 3, 9, 2,
4, 9, 2, 9, 1, 2, 9, 2, 2, 9, 3, 2, 9, 4, 2, 9, 9,
3, 1,
9, 3, 2, 9, 3, 3, 9, 3, 4, 9, 3, 9, 1, 3, 9, 2, 3, 9,
3, 3, 9, 4, 3, 9, 9,
4, 1, 9, 4, 2, 9, 4, 3, 9, 4, 4, 9, 4, 9, 1, 4, 9, 2, 4, 9, 3, 4, 9, 4, 4, 9, 9,
9, 1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 9, 2, 1, 9, 2,
2, 9, 2, 3, 9, 2, 4, 9, 2, 9,
9, 3, 1, 9, 3, 2, 9, 3,
3, 9, 3, 4, 9, 3, 9, 9, 4, 1, 9, 4, 2, 9, 4, 3, 9, 4,
4, 9, 4, 9,
9, 9, 1, 9, 9, 2, 9, 9, 3, 9, 9, 4, 9, 9,
9
$endgroup$
add a comment |
$begingroup$
try
Select[Tuples[1,2,3,4,9,3],MemberQ@9]
1,1,9,1,2,9,1,3,9,1,4,9,1,9,1,1,9,2,1,9,3,1,9,4,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,1,2,9,2,2,9,3,2,9,4,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,1,3,9,2,3,9,3,3,9,4,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,1,4,9,2,4,9,3,4,9,4,4,9,9,9,1,1,9,1,2,9,1,3,9,1,4,9,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,9,9,1,9,9,2,9,9,3,9,9,4,9,9,9
$endgroup$
$begingroup$
This can even be shortened toSelect[Tuples[1,2,3,4,9,3], MemberQ[9]]
.
$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
add a comment |
$begingroup$
L = Tuples[1, 2, 3, 4, 9, 3];
Pick[L, Total /@ UnitBox[L - 9], 1 | 2 | 3]
Or
Pick[L, Total /@ UnitStep[L - 8], 1 | 2 | 3]
$endgroup$
add a comment |
$begingroup$
lst // Pick[#, Times@@@(# /. 9-> 0), 0] &
and
Pick[lst,Times@@@(lst/. 9-> 0),0]==
Pick[lst, MemberQ[#,9]&/@lst]
$endgroup$
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
list=Tuples[1, 2, 3, 4, 9, 3] ;
Cases[___,9,___]@list
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1, 1, 9, 2, 1,
9, 3, 1, 9, 4, 1, 9, 9,
2, 1, 9, 2, 2, 9, 2, 3, 9, 2,
4, 9, 2, 9, 1, 2, 9, 2, 2, 9, 3, 2, 9, 4, 2, 9, 9,
3, 1,
9, 3, 2, 9, 3, 3, 9, 3, 4, 9, 3, 9, 1, 3, 9, 2, 3, 9,
3, 3, 9, 4, 3, 9, 9,
4, 1, 9, 4, 2, 9, 4, 3, 9, 4, 4, 9, 4, 9, 1, 4, 9, 2, 4, 9, 3, 4, 9, 4, 4, 9, 9,
9, 1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 9, 2, 1, 9, 2,
2, 9, 2, 3, 9, 2, 4, 9, 2, 9,
9, 3, 1, 9, 3, 2, 9, 3,
3, 9, 3, 4, 9, 3, 9, 9, 4, 1, 9, 4, 2, 9, 4, 3, 9, 4,
4, 9, 4, 9,
9, 9, 1, 9, 9, 2, 9, 9, 3, 9, 9, 4, 9, 9,
9
$endgroup$
add a comment |
$begingroup$
list=Tuples[1, 2, 3, 4, 9, 3] ;
Cases[___,9,___]@list
1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 1, 1, 9, 2, 1,
9, 3, 1, 9, 4, 1, 9, 9,
2, 1, 9, 2, 2, 9, 2, 3, 9, 2,
4, 9, 2, 9, 1, 2, 9, 2, 2, 9, 3, 2, 9, 4, 2, 9, 9,
3, 1,
9, 3, 2, 9, 3, 3, 9, 3, 4, 9, 3, 9, 1, 3, 9, 2, 3, 9,
3, 3, 9, 4, 3, 9, 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, 1, 9, 4, 1, 9, 9,
2, 1, 9, 2, 2, 9, 2, 3, 9, 2,
4, 9, 2, 9, 1, 2, 9, 2, 2, 9, 3, 2, 9, 4, 2, 9, 9,
3, 1,
9, 3, 2, 9, 3, 3, 9, 3, 4, 9, 3, 9, 1, 3, 9, 2, 3, 9,
3, 3, 9, 4, 3, 9, 9,
4, 1, 9, 4, 2, 9, 4, 3, 9, 4, 4, 9, 4, 9, 1, 4, 9, 2, 4, 9, 3, 4, 9, 4, 4, 9, 9,
9, 1, 1, 9, 1, 2, 9, 1, 3, 9, 1, 4, 9, 1, 9, 9, 2, 1, 9, 2,
2, 9, 2, 3, 9, 2, 4, 9, 2, 9,
9, 3, 1, 9, 3, 2, 9, 3,
3, 9, 3, 4, 9, 3, 9, 9, 4, 1, 9, 4, 2, 9, 4, 3, 9, 4,
4, 9, 4, 9,
9, 9, 1, 9, 9, 2, 9, 9, 3, 9, 9, 4, 9, 9,
9
answered Jun 2 at 7:33
kglrkglr
197k10220442
197k10220442
add a comment |
add a comment |
$begingroup$
try
Select[Tuples[1,2,3,4,9,3],MemberQ@9]
1,1,9,1,2,9,1,3,9,1,4,9,1,9,1,1,9,2,1,9,3,1,9,4,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,1,2,9,2,2,9,3,2,9,4,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,1,3,9,2,3,9,3,3,9,4,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,1,4,9,2,4,9,3,4,9,4,4,9,9,9,1,1,9,1,2,9,1,3,9,1,4,9,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,9,9,1,9,9,2,9,9,3,9,9,4,9,9,9
$endgroup$
$begingroup$
This can even be shortened toSelect[Tuples[1,2,3,4,9,3], MemberQ[9]]
.
$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
add a comment |
$begingroup$
try
Select[Tuples[1,2,3,4,9,3],MemberQ@9]
1,1,9,1,2,9,1,3,9,1,4,9,1,9,1,1,9,2,1,9,3,1,9,4,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,1,2,9,2,2,9,3,2,9,4,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,1,3,9,2,3,9,3,3,9,4,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,1,4,9,2,4,9,3,4,9,4,4,9,9,9,1,1,9,1,2,9,1,3,9,1,4,9,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,9,9,1,9,9,2,9,9,3,9,9,4,9,9,9
$endgroup$
$begingroup$
This can even be shortened toSelect[Tuples[1,2,3,4,9,3], MemberQ[9]]
.
$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
add a comment |
$begingroup$
try
Select[Tuples[1,2,3,4,9,3],MemberQ@9]
1,1,9,1,2,9,1,3,9,1,4,9,1,9,1,1,9,2,1,9,3,1,9,4,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,1,2,9,2,2,9,3,2,9,4,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,1,3,9,2,3,9,3,3,9,4,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,1,4,9,2,4,9,3,4,9,4,4,9,9,9,1,1,9,1,2,9,1,3,9,1,4,9,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,9,9,1,9,9,2,9,9,3,9,9,4,9,9,9
$endgroup$
try
Select[Tuples[1,2,3,4,9,3],MemberQ@9]
1,1,9,1,2,9,1,3,9,1,4,9,1,9,1,1,9,2,1,9,3,1,9,4,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,1,2,9,2,2,9,3,2,9,4,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,1,3,9,2,3,9,3,3,9,4,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,1,4,9,2,4,9,3,4,9,4,4,9,9,9,1,1,9,1,2,9,1,3,9,1,4,9,1,9,9,2,1,9,2,2,9,2,3,9,2,4,9,2,9,9,3,1,9,3,2,9,3,3,9,3,4,9,3,9,9,4,1,9,4,2,9,4,3,9,4,4,9,4,9,9,9,1,9,9,2,9,9,3,9,9,4,9,9,9
edited Jun 2 at 9:58
answered Jun 2 at 7:33
J42161217J42161217
5,400525
5,400525
$begingroup$
This can even be shortened toSelect[Tuples[1,2,3,4,9,3], MemberQ[9]]
.
$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
add a comment |
$begingroup$
This can even be shortened toSelect[Tuples[1,2,3,4,9,3], MemberQ[9]]
.
$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
$begingroup$
This can even be shortened to
Select[Tuples[1,2,3,4,9,3], MemberQ[9]]
.$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
This can even be shortened to
Select[Tuples[1,2,3,4,9,3], MemberQ[9]]
.$endgroup$
– Henrik Schumacher
Jun 2 at 9:36
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
$begingroup$
@HenrikSchumacher nice!
$endgroup$
– J42161217
Jun 2 at 9:58
add a comment |
$begingroup$
L = Tuples[1, 2, 3, 4, 9, 3];
Pick[L, Total /@ UnitBox[L - 9], 1 | 2 | 3]
Or
Pick[L, Total /@ UnitStep[L - 8], 1 | 2 | 3]
$endgroup$
add a comment |
$begingroup$
L = Tuples[1, 2, 3, 4, 9, 3];
Pick[L, Total /@ UnitBox[L - 9], 1 | 2 | 3]
Or
Pick[L, Total /@ UnitStep[L - 8], 1 | 2 | 3]
$endgroup$
add a comment |
$begingroup$
L = Tuples[1, 2, 3, 4, 9, 3];
Pick[L, Total /@ UnitBox[L - 9], 1 | 2 | 3]
Or
Pick[L, Total /@ UnitStep[L - 8], 1 | 2 | 3]
$endgroup$
L = Tuples[1, 2, 3, 4, 9, 3];
Pick[L, Total /@ UnitBox[L - 9], 1 | 2 | 3]
Or
Pick[L, Total /@ UnitStep[L - 8], 1 | 2 | 3]
answered Jun 2 at 11:03
Okkes DulgerciOkkes Dulgerci
5,6931920
5,6931920
add a comment |
add a comment |
$begingroup$
lst // Pick[#, Times@@@(# /. 9-> 0), 0] &
and
Pick[lst,Times@@@(lst/. 9-> 0),0]==
Pick[lst, MemberQ[#,9]&/@lst]
$endgroup$
add a comment |
$begingroup$
lst // Pick[#, Times@@@(# /. 9-> 0), 0] &
and
Pick[lst,Times@@@(lst/. 9-> 0),0]==
Pick[lst, MemberQ[#,9]&/@lst]
$endgroup$
add a comment |
$begingroup$
lst // Pick[#, Times@@@(# /. 9-> 0), 0] &
and
Pick[lst,Times@@@(lst/. 9-> 0),0]==
Pick[lst, MemberQ[#,9]&/@lst]
$endgroup$
lst // Pick[#, Times@@@(# /. 9-> 0), 0] &
and
Pick[lst,Times@@@(lst/. 9-> 0),0]==
Pick[lst, MemberQ[#,9]&/@lst]
answered Jun 2 at 8:01
user1066user1066
6,27822033
6,27822033
add a comment |
add a comment |
2
$begingroup$
Help > Wolfram Docuentation, enter "select" (with or without quotes). First hit is to
Select
...$endgroup$
– Daniel Lichtblau
Jun 2 at 11:59