Questions on using or implementing more or less common data structures such as linked lists, structs, trees, tries, heaps etc. in Mathematica.

learn more… | top users | synonyms

3
votes
2answers
159 views

Mathematica data structures for analysis [closed]

I'm starting to learn Mathematica and one thing that has been bugging me is the apparent lack of a good structure for keeping data and metadata for analysis. Something along R's ...
2
votes
1answer
50 views

Structure of KernelMixtureDistribution and SmoothKernelDistribution

I would like to know more about the structure behind the KernelMixtureDistribution and SmoothKernelDistribution in Mathematica. ...
17
votes
1answer
223 views

Make my data-structure atomic

Lately, and by lately I mean since version 7 or so, the number of atomic expressions in Mathematica constantly grew. In former times only the native types like integers and optimised arrays were ...
0
votes
1answer
27 views

Right data format when EmpiricalDistribution expects “Rectangular Array”

I have the following code to generate random data (these are the eigenvalues of a non-central Wishart matrix, and I am interested in their distribution). ...
1
vote
1answer
60 views

ReadList or any other command to read in blocks of very large numbers

I have a data file, data.txt, having following data: ...
10
votes
1answer
126 views

Why won't SparseArray let me store values with the head List?

When you attempt to define a SparseArray with elements that have the head List it complains: ...
3
votes
3answers
159 views

Breaking up combined data into several smaller data sets

I have one combined data with first number as the x-value and the remaining as different y-axis values (y1,y2,y3...). How do I break this combined list, data= (x,y1,y2,y3...) into smaller lists, such ...
4
votes
0answers
63 views

How to save the result in the Notebook (.nb) and shut down the computer when the calculation is done

I have a notebook(.nb) which its calculation is time-consuming and long. I can not observe it if the calculation is done or not. Therefore, I want to : (1) Save the results in the notebook(.nb) ( I ...
8
votes
0answers
228 views

Learning Resources for Data Science in the Wolfram Language

I'm delivering an upcoming course on Data Science with the programming/analysis done predominantly in the Wolfram Language. I created the following table to leverage students' familiarity with Lists ...
5
votes
1answer
243 views

Converting hierarchies of rules to associations

The impossibility of MatchQ-ing inside and Association MatchQ-ing Associations (MMA 10) explains a problem I have. I would like ...
3
votes
1answer
137 views

how to create Dataset after importing txt file

I would like to translate a imported txt file to Dataset. ...
0
votes
4answers
135 views

Using levels in MapIndexed

I am trying to use MapIndexed to manipulate a matrix of data but I am having trouble getting the levels parameter to work the way I would like. Suppose that my data ...
21
votes
3answers
529 views

Error changing Dataset using Part

In the new guide Computation With Structured Datasets we can find this part, on how to change a Dataset But if we create a Dataset like: ...
60
votes
3answers
2k views

How to make use of Associations?

I have been curious about it for long. Now that Mathematica 10 arrives, I think it's time to ask the question: How the new Association data structure would be used ...
1
vote
0answers
99 views

What's a non-trivial Mathematica program involving conscious choice of stack vs. queue data structure?

In a typical computer science algorithms course, much attention is given to the discussion of queues vs. stacks as a data structure programmers need to consciously choose from to achieve algorithmic ...
21
votes
2answers
836 views

How can I add a column into a existing Dataset?

I'm very excited about the brand new Dataset function. I have played with it in Wolfram Cloud, and haven't figured out how can I add a new column into an existing ...
1
vote
0answers
56 views

Data structures sought for storing particular list information

I have a set of lists. These lists contain two dimensional coordinates of natural numbers. So a list can be ...
1
vote
1answer
61 views

DownValues Type Access and Timing

I definitely use so much DownValues structure for some many applications like to replace some common structures in a some way. It seems that DownValues is so fast for access, and set. My question is ...
2
votes
2answers
109 views

Extracting “records” from a matrix

From a rank 3 matrix like ...
4
votes
2answers
417 views

What is the Mathematica way of joining two tables?

Is there a special Mathematica way of joining tables of data together, so that I would get similar functionality as if I was running a database with sql? For example, I have one particular table ...
2
votes
2answers
459 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. ...
0
votes
1answer
90 views

Matrix Operation

I have a $3\times3$ matrix A, and a function sTrans that outputs two $3\times3$ matrices in a list when given a $3\times3$ ...
2
votes
1answer
462 views

Interpolation: Unstructured grid error

If I try to make a table SimpleTable and to interpolate a function of two variables, I encounter a problem. For example: ...
2
votes
3answers
284 views

Re-arranging / selecting of a data table very slow in For loop [duplicate]

My task is quite simple; I have a table of data like M = {{1,2}, {1,3}, {3,4}, {5,1}, {6,9}, {6,8}, {6,1}}; so the table is sorted with respect to the first ...
3
votes
1answer
116 views

Reading many single files and creating numbered (? or indexed) variable

I tried many different approaches, but I could not solve the following problems, I appreciate your help: What is the best way to read many data files? I mean we have ...
2
votes
0answers
61 views

Autoupdate Section Numbers? - Technical Document Authoring with Mathematica

Technical document authoring systems are structured ways to create, manage, and update documentation for various mediums such as print, pdf, web, etc. Take a look at this technical document ported to ...
6
votes
1answer
143 views

Return struct from function (with DownValues)

In Mathematica there is a way to create struct-like data type: struct[myField]=value I want to return myStruct from a function: ...
2
votes
1answer
111 views

Distances of locations in the matrix form

I want to have the distances of the cities in the matrix form.How can I have it for example for the cities like followings that also includes the distance of the city from itself which is zero: ...
15
votes
2answers
455 views

Efficient priority queues?

I'm trying to figure out how to transfer the concept of a priority queue to the functional world. Searches have turned up some implementations that use Append and other expense list copying ...
11
votes
3answers
2k views

Implementing a dictionary data structure

As one learns from a course on data structures, hash maps or dictionaries can be efficient when applied to appropriate tasks. I need a hash map in Mathematica and I've never found it. I'm scratching ...
1
vote
0answers
67 views

Efficiently generating 3D histograms for large sets 2D coordinates [duplicate]

I'm attempting to generate a 3D histogram for a large set of two-dimensional coordinates ($\approx 10^7$). the x- and y-components of each coordinate are rounded to the nearest integer, and these ...
1
vote
2answers
548 views

Import Spreadsheet Data and DeleteCases of empty cells &/or choosing a Range to import

I am importing Excel spreadsheet data into Mathematica. Here is what the data looks like, notice the cell Q1 with "sdf": I import this data by specifying the Spreadsheet location, sheet name, top ...
2
votes
1answer
105 views

Mean of Date variable data

I have hourly registered data as : ...
5
votes
1answer
166 views

Error in ARIMAProcess example

I am trying to compile the sample of ARIMAProcess of MMA here .It doesn't work.What is wrong?Could you please help?I am using exact same code. ...
1
vote
3answers
102 views

DateListPlot input entry problem

I imported some data from Excel and got the following for my date and values: {{{1986, 1, 2, 0, 0, 0.}, 25.56, ""}, {{1986, 1, 3, 0, 0, 0.}, 26., ""} It seems ...
3
votes
1answer
214 views

How to determine cluster membership using FindClusters?

I have a 1000 by 3 data matrix in which for each person we have 3 scores. I want to cluster those persons into 8 cluster using Agglomerative method. I did the clusetring by: ...
10
votes
1answer
206 views

Is there a method to enumerate the keys/values of System`Utilities`HashTable

Lacking from the simple API of System`Utilities`HashTable is a method to enumerate the keys/values. ...
5
votes
1answer
169 views

What is the fastest way to maintain a large set of expressions?

In my algorithm I need to maintain a set (an unordered list of distinct elements) of expressions supporting two operations: Test an expression for membership in the set Adding a new expression to ...
1
vote
3answers
135 views

How to convert a spaceless data into tab delimited

I have a data set in form of:(this is just an example) 1324501020 3241030205 4332020134 the data are stored in a text file (e.g. data.txt) but I need to convert ...
8
votes
2answers
222 views

Distribute and analyze large datasets

I need to analyze very large datasets, and they obviously don't fit in a computer memory. I need to produce some statistics on these datasets, and this brings me here: How can I make some statistical ...
9
votes
1answer
266 views

Efficient way to solve equal sums $x_1^k+x_2^k+\dots+x_5^k=y_1^k+y_2^k+\dots+y_5^k$ with Mathematica?

I need to solve the system of equations, call it $S_1$, in the integers $$x_1x_2x_3x_4x_5 = y_1y_2y_3y_4y_5$$ $$x_1^k+x_2^k+\dots+x_5^k=y_1^k+y_2^k+\dots+y_5^k,\;\; k= 2,4,6$$ I used a very ...
2
votes
2answers
308 views

How to populate a table using a rule replacement

I am trying to populate the rows and columns of a table by using a rule replacment. To generate a table that looks like this For example Sc would be row 1, column 1. An example of a record looks ...
5
votes
2answers
312 views

DownValue “associative array” to list? [duplicate]

I have a "sparse array" like this arr[1.5]=0.4, arr[3.5]=0.7, arr[7]=0.3 which is not really a sparse array since the keys are not all integers. This is like a ...
1
vote
2answers
198 views

Efficient Data Entry / Manipulation with Many Datasets

I currently have a simple task of graphing many different datasets (26 here, with many different instances where I'll need to do, say, 26 different ones from the same template). I'm trying to ...
1
vote
1answer
190 views

How do I create a graph with randomly directed edges starting from a undirected graph?

I have an undirected graph $G$. How would I randomly assign directions to some fraction $p$ of the edges? How might I do this efficiently / quickly provided I have a large graph structure? For ...
0
votes
2answers
144 views

Iterating Reads From a Text File and Writing the Results of Operation

I have a very large text (TSV) file. I am able to now read single line, thanks to StackExchange. I am able to read a part of that line using the part operator. I want to iterate through the whole ...
1
vote
0answers
252 views

Data structure for a list of actions

The idea: I need to generate a sequence of events then run a "propagator" over the list of events where the "propagator" will update the state of the following event. I can then write functions that ...
1
vote
1answer
307 views

Read a file into a list of vectors [closed]

I have file structured as (Axis 1) (Axis 2) Data. As an example: ...
14
votes
1answer
505 views

Efficient code for tallying entries in very large lists

I am dealing with data sets containing tens of millions of (hashable) entries and simply using the Tally function to count the frequency of each unique list element ...
5
votes
1answer
238 views

Processing and storing a graph with a large number of vertices s.t. k-hop neighborhoods are efficiently retrievable

I have an unweighted, undirected graph $G$ with $(v_1, ..., v_N) \in V$ vertices, where each vertex in the lattice represents a string of some length ($\leq 200$ characters), and I need to construct ...