Turn string with () as function brackets into expression
I have a text file with an equation where all the brackets are formatted as (). For example I read in the equation 2*(Re(a)+Im(b)) as a string. Now I am wondering if I can make this into an expression...
View ArticleHow to get the desired LLM response in string robustly with and without using...
I am trying to query a large language model from VS code using WolframEngine.However, ImportSting with JSON options does not work in extract the desired output string of the LLM response. So I use the...
View ArticleHow to properly write fraction in style
I would like to write the following for the legend of a curve :$$ Theta = \frac{\pi}{2}$$Where the value $\frac{\pi}{2}$ is actually in a variable named $Theta$ (same name as the text on the lhs of the...
View ArticleMatch two lists based on same elements
I have two large lists:list1 = {{a,v},{a,h},{b,v},{b,k},{c,t},{c,r},{d,r}};list2 = {{v,dc},{v,rt},{h,kl},{h,oi},{h,po},{k,ö},{k,dc},{t,re},{r,qw},{r,ay},{r,ül}};Now I want a list that matches both...
View ArticleHow to speed up ToString[#,TeXForm]&?
Try the following code to convert the expression to LaTeX codef = Expand[(x/2 + y/3 + z/5 + 1/7)^20];str = ToString[f,TeXForm]; // AbsoluteTimingIt took about 1 minute, while sympy.latex only took 0.6...
View ArticleHow to parse out a word's position in a data set
I'm trying to find better ways to import data. My data set is a CSV that contains a parameters at the end of the file. For example in this two part list I want to find the position at which the word...
View Article