All Questions

Filter by
Sorted by
Tagged with
3
votes
1answer
40 views

Get subscripts of sum of expression and save each summand's subscript separately

I deal with expressions like A= a_i a_j a_k + a_i a_l a_m+ ... where the a_i notation is shorthand for Subscript["a",i] and all subscripts are integers. In this ...
0
votes
1answer
50 views

Delete elements form a list with elements with strings and numbers

I am trying to create a list list2 removing elements from a list list. The structure of list...
0
votes
1answer
28 views

Count the number of words in WordList that start with a “q” [closed]

How can I create a subset of WordList[] that contains only the words that start with "g"?
-3
votes
1answer
46 views

Performing loop operation (average on lists of datas) of strings of datas [closed]

Lets say I have 100 CSV files of two columns data in each file, and I want to calculate the average of the 2nd column of each CSV file and then save all all these 100 averaged values in one CSV file (...
1
vote
1answer
73 views

How to generate letters for multiple people from a list of names

I need to generate many letters of invitation from a list of people. I thought this would be already asked/answered in this forum, but I can't find anything useful. Basically, I need to write a letter ...
0
votes
2answers
74 views

Comparing strings within a list of strings

I have a single list containing strings like this: list={"house", "cat", "dog" ,"horse", "horses", "tree"}; How can I compare these strings within a list and ...
4
votes
2answers
156 views

Commonest[] function doesn't actually show commonest elements

I'm using Commonest function on a list with 500000 words to get the 10 most frequent elements. Then by using WordCloud, I found ...
2
votes
1answer
55 views

comparing lists of strings

I have two lists of strings like this: ...
0
votes
2answers
60 views

Creating a table in a while loop

I am probably missing something obvious, but I am stuck. I am writing a code on Mathematica for Newton's method, and I need to print out a table for the iteration, approximation root, residual, and ...
4
votes
2answers
110 views

Deleting unwanted elements in lists of words

I have imported Alice in Wonderland into Mathematica. I have made a list of the sentences and further divided them into words. Now suppose, nominally, I have the following list: ...
3
votes
3answers
200 views

Selecting elements from lists based on string pattern

I have a list: lis = {{"abc", 1, 2}, {"cde", 3, 4}, {"fgbc", 5, 6}} I would like to select list items that have first elements that end in the string "bc" to ...
0
votes
1answer
54 views

Modification to the list of string

Suppose we have a list of the following: l={"applejuice","lemon_juiceginger"} How can one modifies this to read as: ...
1
vote
3answers
62 views

Manipulation of two lists of strings and integers

I have the following lists: ...
4
votes
1answer
76 views

String Join but not fully

Suppose I have the following string list: l={{"a","dog"},{"the","pen"}} how can I turn this to {{"a dog"},{"the pen"}} I ...
1
vote
3answers
109 views

Finding the frequency of letters in a string

Given the following string: ...
1
vote
1answer
59 views

Selecting elements using two lists

I made the following list: ...
4
votes
1answer
158 views

Selecting an element of a matrix that contains specific string

I have the following matrix: ...
12
votes
0answers
103 views

What changed in String handling between 11.0 and 11.3?

I was trying to optimize some String-handling code here using my standard trick of converting it to a list of bytes first and using basic list operations instead of ...
4
votes
3answers
127 views

List rearrangment with joining of strings

I have a list of strings: lis = {{"a","b","x"},{"d","e","y"},{"a","b","z"},{"d","c","x"},{"a","b","w"}} I would like to use StringJoin on the last elements where ...
3
votes
2answers
92 views

How to remove adjacent date strings in a list?

Given a list as list = {"2018-9-1",1,2,3,"2018-9-2","2018-9-3",4,5,6,"2018-9-5",7,8,9,"2018-9-6","2018-9-7",10,11,12,"2018-9-8",13,14,15,"2018-9-9",16,17,18} or ...
11
votes
3answers
460 views

Loop over a list of strings and increment letter count in a corresponding sublist

I have a 2D list as follows: ...
13
votes
3answers
426 views

Generating a pattern from user-defined rules

I want to generate a list of $L$ and $S$ according to the following rule: upon each iteration, replace $S \rightarrow L$ $L \rightarrow LS$ Such that, starting with $L$: $ L \rightarrow LS \...
8
votes
2answers
236 views

Deleting certain integers from string list

I have a list of strings: lis = {"a","1","b","2","c","3","a","d","4"} and would like to get: ...
4
votes
1answer
120 views

Jaro distance in MMA

I'm trying to program Jaro distance as requested by this page I've done the following code that works well for the next two pairs ("MARTHA", "MARHTA") and ("DIXON", "DICKSONX") but when I try with ("...
1
vote
2answers
42 views

Changing the style in a list

I have the following list, l={{"a", "b"}, {"c", "d"}} I was wondering how can I convert it into: output: {"ab", "cd"}
0
votes
1answer
84 views

Generating list of labeled string [closed]

I want to generate a table that gives the following output: output: {"x1", "x2", "x3", "x4", "x5"} I have tried: ...
3
votes
2answers
193 views

Deleting unwanted spaces in a list of string

I have a badly structured data and I need to clean it up, suppose I have the following list: l={{"a","b","c"},{"e"," f","g"},{" a"," b"}} As you can see they ...
7
votes
2answers
221 views

Select UPPER CASE list items with spaces and punctuation

I have a sample list that includes people's names in Title Case, and their companies in UPPER CASE. ...
2
votes
1answer
81 views

DeleteCases not working as expected

I am trying to reproduce the example of Data Cleaning from here. I had to make a slight change in input 13 to ...
0
votes
0answers
22 views

create a list with common head [duplicate]

How to create a list like below by Table #& or others? j1, j2, j3, j4 ... j15 ...
4
votes
2answers
71 views

Pulling sections from a webpage

I'm trying to get specific sections from a webpage using Mathematica. I've started by importing the webpage, and getting the section "headers" that I want: ...
1
vote
0answers
53 views

Reconstructing a partition from its character

Given a solid partition $\rho=\{\pi_1, \pi_2, ..\}$, where $\pi_a$ are plane partitions such that $\pi_{a+1} \subset \pi_a$, we can compute its character, which is a sum of monomials with non-negative ...
4
votes
2answers
255 views

Splitting nasty list FAILED

I am still a beginner with Mathematica and I have a simple problem with splitting this list: ...
1
vote
2answers
110 views

Extract values from a string list with string elements like “ Id=\”1\“ ”

I have a simple problem which I am not able to work around. I have this list ...
1
vote
1answer
64 views

How do I remove parts of this data?

The data: ...
9
votes
3answers
560 views

StringJoin with Spaces

I'm having some trouble using StringJoin --- the problem is that the StringJoin function creates a string where all the words in a list are combined without any spaces (whitespace) For instance, list ...
2
votes
2answers
4k views

How to Output Lists without Commas or Brackets?

When trying the below code, is there a more elegant way to output the numbers without the commas or brackets? Grid, as suggested in other threads, is not behaving ...
4
votes
3answers
392 views

Deleting certain elements of a list

This query is similar to a question I posted earlier. Given testList = {{"a", "b 3", "cd", "ef 23"}, {"z 12", "y", "x"}, {"z", "y"}, {"a", "b3"}}; I would ...
5
votes
1answer
166 views

Eliminating items from list by rule

I have a list: testList={{"a","b 3","cd","ef 23"},{"z 12","y","x"}} and wish to obtain resultList={{"b 3","ef 23"},{"z 12"}} ...
2
votes
1answer
68 views

Convert Negative Integers into Signed Binary?

I'm relatively new to Mathematica and have been struggling with this problem for several days. I have a string of integer data, ranging from -2044 to 2044. So this looks something like {-2044,-2040,-...
0
votes
2answers
265 views

Dataset, use list as header

I have a dataset with a header for row and column which consists of binaries, e.g.: ...
0
votes
1answer
103 views

Parse large ASCII matrix

I am parsing a large ASCII sparse matrix, output of PETSc, but my current implementation is impossibly slow. I don't know how I could speed that up. The ASCII file of a sparse PETSc ...
4
votes
3answers
582 views

How to Add strings into each element of a list [closed]

This is a rather basic question but as I am new to programming, I have been stuck on it for a little while. I am trying to add strings to the beginning and end of every element in a list (each element ...
3
votes
2answers
76 views

Isolate first order elements

How can I isolate only the first order "h" terms in the following expression? ...
4
votes
2answers
162 views

Getting the value of sentences

I have a list, importance, that assigns a "value" to each word in some text, like such: { {the, 0.9}, {and, 1}, {red, 2.1} } ...
7
votes
5answers
291 views

Element combinations

I have a list: lis = {"ab", "cde", 2,"rs",3,"tu","v","w",7} and would like to get the following list: ...
6
votes
5answers
189 views

List of symbols wherein position encoded by number to string

How to transform list wherein position of the symbol encoded by number at second position {{a,6},{z,1},{g,2},{y,12}} to string ...
2
votes
2answers
95 views

Get alphabetical number of characters in string

Given a string such as "abcdefghijklmnopqrstuvwxyz", how would I go about returning a list of the alphabetical number of each letter in the string, example being <...
1
vote
1answer
38 views

Some challenge for a Table mixing between output number Variables and ToString symbols [duplicate]

How can I output a series of data, ranging from s00, s01, s02, s10, s11, s12, s20, s21, s22; by writing a table with s is a fixed, and m and n are running parameters, for example: ...
5
votes
1answer
148 views

Adding a collection of neighbors to points in a list, concatenating strings, parallelization/optimizing run-time?

Before beginning, I want to note that there are some similarities with the questions Combining two lists of different dimensions into a list of all combinations of points? How can I make threading ...