Skip to main content
8 votes

Row function to join together binary number elements

Map[FromDigits @* Flatten @* IntegerDigits, testlist, {2}] ...
kglr's user avatar
  • 398k
8 votes

Row function to join together binary number elements

Let's define a function that joins together two of the entries: join[{x_, y_}] := ToExpression[StringJoin[{ToString[x], ToString[y]}]]; Now we can use this ...
bill s's user avatar
  • 69.3k
7 votes

How to find the most repeating row?

First @ Keys @ ReverseSort @ Counts[tab] {1, 0, 0, 1} Or First @ Normal @ ReverseSort @ Counts[tab] {1, 0, 0, 1} -> 3 ...
eldo's user avatar
  • 78.4k
7 votes
Accepted

How to find the most repeating row?

tab = {{1, 0, 0, 1}, {1, 0, 0, 1}, {0, 1, 0, 1}, {1, 0, 0, 1}, {0, 0, 0, 1}, {1, 0, 0, 0}, {0, 1, 0, 1}} Commonest[tab] {{1, 0, 0, 1}} ...
Syed's user avatar
  • 55.7k
6 votes

Select specific rows of a dataset

You can also use dataset[Select[MatchQ[#a, 2 | 4 | 5] &]] Select[MatchQ[#a, 2 | 4 | 5] &] @ dataset ...
kglr's user avatar
  • 398k
6 votes
Accepted

Select specific rows of a dataset

Query[Select[MemberQ[{2, 4, 5}, #a] &]]@dataset
Slepecky Mamut's user avatar
6 votes

How to find the most repeating row?

MaximalBy[PositionIndex[tab],Length] (* <|{1, 0, 0, 1} -> {1, 2, 4}|> *)
user1066's user avatar
  • 20.2k
5 votes
Accepted

Applying different values to string row

t = {1, 4, 4, 22, 3, 12, 54, 65} Other ways: ...
Kuba's user avatar
  • 137k
5 votes
Accepted

Row function to join together binary number elements

...
Syed's user avatar
  • 55.7k
5 votes

How to find the most repeating row?

Just for variety and to show comparison.MaximalBy as per other users. I have voted for other answers. ...
ubpdqn's user avatar
  • 62.1k
3 votes
Accepted

Plot3D: Inconsistent distance to PlotLabel when using Grid/Row

Use Labeled to place the labels and use the option PlotRegion in Plot3D: ...
kglr's user avatar
  • 398k
3 votes

Row function to join together binary number elements

1 {100, 100} -> 100100 f[{x_,y_}] = x*10^IntegerLength[x] + y; f[{100,100}]; 2 ...
AsukaMinato's user avatar
  • 9,988
3 votes

Different output by HoldForm inside a row function

You're looking for AutoMultiplicationSymbol: ...
Lukas Lang's user avatar
  • 34.2k
3 votes

How to change an element in matrix, based on equality of other elements?

...
kglr's user avatar
  • 398k
3 votes
Accepted

Style function not working inside Print Row functions

Try list = {a, b, c}; Separator = Style[" | ", Darker[Green], Bold, 12]; Row[Flatten@ Table[ {ToString[list[[i]]], Separator}, {i, Length[list]}]] Or ...
Nasser's user avatar
  • 146k
3 votes

Select specific rows of a dataset

The above answers are excellent, and complete, but when prototyping code, I often find the array indexing with datasets to be useful and sometimes a bit easier to type. Like so: ...
BesselFunct's user avatar
3 votes
Accepted

Excluding Specific Rows Using Import[...]

As mentioned in the comments to your question, you just Import the whole data and then manipulate it afterwards. This is (I believe) a very transparent way to ...
Lukas's user avatar
  • 2,702
3 votes

How to find the most repeating row?

Another method using GroupBy and Repeated: ...
E. Chan-López's user avatar
2 votes

Applying different values to string row

Perhaps: t = {1, 4, 4, 22, 3, 12, 54, 65}; a = ">}{<" Row[{"{<"}~Join~Riffle[t, a]~Join~{">}"}] or ...
ubpdqn's user avatar
  • 62.1k
2 votes

How do I apply an image filter row by row

Thanks to Kuba I came up with this: ...
Julien M's user avatar
  • 141
2 votes

Applying different values to string row

In: ...
webcpu's user avatar
  • 3,202
2 votes

Periodical sum of rows by a certain step

Try with the following code: ...
E. Chan-López's user avatar
2 votes

Periodical sum of rows by a certain step

Here we set n=14 instead of n=12 to test the method. ...
cvgmt's user avatar
  • 76.9k
2 votes

Periodical sum of rows by a certain step

...
Bob Hanlon's user avatar
  • 160k
2 votes

Periodical sum of rows by a certain step

ClearAll[f1] f1[m_] := Total[Transpose @ Partition[m, Dimensions[m][[2]]], {2}] f1 @ matrix ...
kglr's user avatar
  • 398k
2 votes

Row function to join together binary number elements

list = {{{100, 100}, {101, 101}}, {{110, 110}, {111, 111}}, {{111, 100}, {111, 110}}, {{101, 111}, {110, 101}}}; Using ...
E. Chan-López's user avatar
2 votes

Row function to join together binary number elements

list = {{{100, 100}, {101, 101}}, {{110, 110}, {111, 111}}, {{111, 100}, {111, 110}}, {{101, 111}, {110, 101}}}; Using ...
eldo's user avatar
  • 78.4k
2 votes

How to apply a function to each row of dataset that I imported to Mathematica and get the result of each row

Let's say this is the mock function with five parameters: f[τ_, r_, σ_, S0_, k_] := r + τ Store data in a text file (say "test.txt" and set the folder ...
Syed's user avatar
  • 55.7k
1 vote

Periodical sum of rows by a certain step

m = Table[i, {i, 12}, {4}]; i = {#, # + 1, # + 2} & @ {1, 5, 9}; Using Query and ...
eldo's user avatar
  • 78.4k
1 vote

Periodical sum of rows by a certain step

You can use SparseArray to create a "summing" matrix, and use Dot: ...
Carl Woll's user avatar
  • 131k

Only top scored, non community-wiki answers of a minimum length are eligible