Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

# Questions tagged [table]

Questions on the use of the Table[] command and other functionality related to lists. Use [tag:matrix] for matrix algebra and related methods, and [tag:list-manipulation] for questions about transforming or operating on existing lists.

101 questions
Filter by
Sorted by
Tagged with
3k views

### How to visualize/edit a big matrix as a table?

Is it possible to visualize/edit a big matrix as a table ? I often end up exporting/copying big tables to Excel for seeing them, but I would prefer to stay in Mathematica and have a similar view as in ...
5k views

### Table of Variables

I use a list of variables {x1, x2, x3} to Solve a particular set of equations. I am now trying to generalise this depending on ...
8k views

### Importing multiple files using a for-loop

once again I am stuck solving a seemingly easy problem :( I would like to make a List of tables by importing data from several txt-Files. Importing the data into a table works so far and I am able to ...
2k views

### Instruct a Table to only evaluate until a condition is fulfilled

I am looking for the way of building a Table of pairs of numbers in a fast way. My true table evaluates huge functions, and I see no way and reason to show those cumbersome expressions here. Let us ...
1k views

### Calling Table with custom iterator

I often find myself in situations where I, for example, need to build a table for some expression, but want to set the number of points rather then the step size, so the code ends up looking like this ...
2k views

### Is there a Break[] equivalent for short-circuiting in Table?

I am running Mathematica 7. The following is admittedly a silly example, but suppose that I have a list list whose entries are either ...
3k views

### How to create functions of arbitrary number of variables? [duplicate]

In the following code what would be the simplest way to generalize it to say some $N_f$ number of $z$ instead of just $z_1$ and $z_2$? ...
837 views

### How do I avoid scoping collisions of iterator variables?

Yesterday I had an issue that kept for quite a while. My code wasn't producing the right results. Now I know why and I am wondering how to avoid the issue in future. Consider the following code. <...
5k views

### How to make a table from two lists?

I have two lists. ...
308 views

### Mysterious behaviour of ParallelTable

This question is related to Export bug in combination with ParallelTable?. The following code shows an even stranger bug than in the upper question. The y-axis should always be logarithmic, but in ...
2k views

### WYSIWYG table creating and editing

In Microsoft Office OneNote 2010, creating and editing tables is easy. There are simple toolbar controls for creating tables: , and editing them once they exist: . My question is, what's an easy ...
7k views

### Generating a list of numbers that are not multiples of 4

I want to write simple code that will list all numbers from $1$ to $n$ that are not multiples of $4$. And in this case I consider that ...
1k views

### Fast way to export large amount of data in “Table” format

I have about a million 3D points, say data = Table[{1. x, 1. y, 0.}, {x, 1000}, {y, 10^3}]~Flatten~1; I want to visualize them, but ...
1k views

### Single Legend for a Table of Plots

For this toy problem ...
300 views

### Export bug in combination with ParallelTable?

I am programming with Mathematica 10.3.1.0 on Windows 10 Professional 64 Bit and have an i7-4940-MX 3,1 GHz processor (4 cores). When I use in the example code below ...
557 views

### TableAlignments -> Left not working

Bug introduced in 7.0 or earlier and persisting through 11.0.1 or later For a very simple dataset TableAlignments->Left does not work: ...
444 views

### Problem with NumberForm when exporting

I have a two-part question regarding NumberForm First question In my attempt at answering this i stumbled upon a strange behavior by NumberForm when the final result is exported. Lets say I have ...
591 views

### Nice presentation of correlation matrix

IO have those data as a text file ...
3k views

### Append[] is not working for empty list [duplicate]

I am trying to create an empty list and add an element but the list is not being populated. My code ...
824 views

### How to use Table to assign values to variables in a list?

I'm trying to do the following: R = {a, b, c, d, e, f, g, h, i}; Table[R[[n]] = RandomInteger[{0, 20}], {n, 1, Length[R]}] My intention is to assign a random ...
2k views

### Table of a two variable function

I would like to generate a table using a function of two variables. I tried the following: Table[{a, b, f[a, b]}, {a, 0, 5}, {b, 0, 5}] which does work as I ...
787 views

### How to properly inject iterators into table? [duplicate]

Goofing off on a prior question, I was fiddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ...
636 views

### Deleting vertices from a Graph and preserving structure

My goal is to remove vertices from graphs (and the edges from them) and then take GraphComplement to find out cut sets in graphs with sink and source such as here. ...
596 views

### Strange behavior of Table

Whenever I run the code a = 0; code := (a++); Table[code; a, {1000}] I get a list of 1000 zeros. However, if I replace 1000 with 100, then a get a list equal to ...
401 views

### How can I write the natural numbers less than $n$ that are coprime to $n$? [duplicate]

How can I write the natural numbers less than $n$ that are coprime to $n$?
904 views

### Unexpected behaviour from Table[]

The following code in Mathematica 11: iList = {i, -10, 10, 2}; Table[i, iList] produces this result: {i, i, i, i} Where in ...
221 views

### How to create a variable List

I need, given "n", create a list {a1,a2,...,an}. For example: Given n=3, the list that must be created is composed by the symbolic variables {a1,a2,a3}. Sorry if this question is simple. Does anybody ...
1k views

### How to generate a table with i != j

I want to generate a table with two indices (say, i and j) such that elements with i = j are omitted. How to achieve it ? Following is a simple example of what I want to do. ...
119 views

### Faster use of Condition for a large array (see the example)

Here is the example/problem. I have a array of $n$ random number. n = 2000; p = RandomReal[{0, 9}, n]; I have to create a $n\times n$ sparse matrix with $(i,j)$...
330 views

### Operations on dynamic arrays [duplicate]

When I do a simple operation like this fib = Table[Fibonacci[i], {i, 15}] and then look to find the position of a certain value, everything works fine: ...
501 views

### Function to marginalize a table over given parameters

Let us say I have generated a table tab with entries {p1,..,pd,chi2[p1,..,pd]} of dimension ...
817 views

### Can Table be used inside Manipulate?

EDIT: CHanged the code. Please try again t see if it works well on our PCs. I am creating a simple Manipulate[] notebook. However when I place Table[] in the code, like: ...
242 views

### direct assignment to the element in a Table

I have already asked a related question here why set values in this way doesn't work? But I think I have to write the question which I encountered explicitly? ...
698 views

### Table with the logarithmic step

Suppose some function y[x]. I need to calculate the table of the value of this function with the logarithmic step of the coordinate, i.e., the operation which corresponds to the Mathematica's command ...
2k views

### Get positions of all non zero matrix elements

I want to find all non zero elements of a table and I want to create a list that contains the name of the table the element was removed from, the position of the element, and the value of the element. ...
1k views

### Create a matrix of matrices using Band and ArrayFlatten [duplicate]

I can easily write a simple Band matrix using: SparseArray[{Band[{2, 1}] -> a}, {Dim, Dim}] where a is a number. Now, I ...
62 views

### Create bold headings and rows in TableForm if x is prime

In the following table ...
1k views

### Relational joining of tables

A common thing to want to do with data is to combine it (at least I thought this was a common thing). In SQL there is the idea of table joins "select id,v1,v2 from A,B where A.id=B.id" kind of thing. ...
419 views

### AccountingForm w/o significant figures

Basically I want to build a chart like something I would do in Excel. It should look like this: Here is the formula I'm using and what I've done so far ...
6k views

### Multiplying two dimensional data by a constant

I have a list of lists of the form: {{1, 2}, {2, 4}, {2, 8}} But I want to multiply only the second dimension of that data by a constant. I know I could do this ...
592 views

### Why doesn't ParallelTable work on this very simple example?

For some reason, I'd like to use ParallelTable with a variable number of iterators. Table[a, {a, 0, 10}] works fine: ...
691 views

### Errors when using ParallelTable inside a package

I'm developing a package that contains a function that requires evaluation of an expensive Table, so I use ParallelTable instead....
514 views

### How to sort Table/Matrix including legend(Labellings)

I want to sort table including its legend for graph I have table similar to M1 M2 M3 1 5 2 3 1 4 4 2 -10 5 7 11 6 -2 1 ...
2k views

### Generating 250 random points crashes the kernel, but not 249

Fixed in 10.1.0. Consider the following function, which generates uniformly random points on the surface of the 2-sphere: ...
339 views

### What is the most straightforward solution to save integers right aligned into a text file?

As an example I have a data list of dimension {10, 5}: ...
333 views

### Optimising Table wrapping over a Select

Suppose we have the following lists: ...
361 views

### Generating an editable table that can be used as input

Say I have a number $n_{max}$. I want a command to generate a table like 1 1 2 2 3 3 4 4 ... nmax nmax where the second column is editable, and this table can be ...
378 views

### Map vs. Table for index-specific operations on 2D arrays

Many experienced users on this site tend to use Map (and its variants, MapAt, MapIndexed, etc.) rather than Table. When applying the same operation to every element of an array, Map does seem more ...