Hot answers tagged

7

I would use a StringTemplate for this, In[46]:= StringTemplate["name_`1`_`2`.PNG"][val1, val2] Out[46]= "name_0.001_500.PNG"


6

As a workaround we can express the Polygon complex through its boundary representation: plot = RegionPlot[x^2 + y^3 < 2, {x, -2, 2}, {y, -2, 2}]; Export["/Users/ghurst/Desktop/plot.pdf", plot]; gcps = Position[plot, gc_GraphicsComplex, ∞]; breps = BoundaryDiscretizeGraphics /@ Extract[plot, gcps]; faceform = Append[ColorData[97, 1], 0.3]; ...


3

This problem is one of those things that comes up a lot, but each question has slight differences that make agreement about being a duplicate is hard to reach. Here is a solution that can achieved by a slight tweak to one line in @Szabolcs' answer: cleanRegionPlot@RegionPlot[..] For instance: Export[FileNameJoin[{$TemporaryDirectory, "clean.pdf"}],...


3

This is an example on how to convert your posted JSON to CSV. Notice that we need to flatten out the data to remove nested fields: ImportString["{\"from\":{\"address_city\":\"MORGANVILLE\",\"address_country\":\"UNITED STATES\",\"address_line1\":\"123 TEST ST\",\"...


3

You can also use numpy's csv writter to export large files, on my computer it is more than 10 times faster than the built in Export function for csv files. The following implementation writes a binary file to disk in Mathematica, then reads it to python and then writes it to a csv file. writeLargeTableToCSV[file_, data_] := Module[{tmp, sess, ...


1

Based on the helpful comments from the community, I was able to solve the problem by writing the file in chunks. Here is the code with the adjustable chunk size. It worked on a small laptop with 8GB of RAM, even though it took 45 minutes. rows = 100000000; (*MaxMemoryUsed: 5GB, Expected CSV file size: 1.3GB*) largeTable = Table[{k, 0, 0}, {k, rows}]; Clear[...


1

Try the following. Notice definition for fileName as well as a slightly different function, so that different derivatives can be calculated (one for each file). myF[x_] := 2 + x^2 + 3 x^3 + 4 x^4 + 5 x^5; fileName[k_Integer] := StringTemplate["L:\\mathematica\\file`1`.m"][ToString@k] In a separate cell, do what you are doing: (I am calculating a ...


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