# Tag Info

8

This is a known problem with nodejs on Windows. The stdout stream is an asynchronous stream and is not always being flushed before the process exits. A work-around is to perform an explicitly synchronous write to stdout (i.e. file descriptor #1): Import["!node -e require('fs').writeSync(1,'test')", "Text"] (* test *) The bug report referenced above ...

7

Mathematica now supports a native connection to GoogleCustomSearch API. To use image search you can do: gs = ServiceConnect["GoogleCustomSearch"] gs["Search",{"Query"-> "Jennifer Lawrence","SearchType"-> "Image"}] To use GoogleCustomSearch API you need an API Key and a Custom search engine ID. To get the API Key you first have to go to ...

6

I wrote this in the comment, but the code did not come out properly formatted. So here it is again: Import["https://en.wikipedia.org/wiki/Mathematica", "Images"]

6

The following works for me in reasonable time, when I have about 3Gb free of RAM: Needs["RLink"] InstallR[] Create the large list in R: REvaluate["tmplist <- vector('list',1000);"]; REvaluate[ "for (i in 1:1000) tmplist[[i]] <- matrix(rnorm(200*1000),200,1000)" ]; // AbsoluteTiming (* {15.8774, Null} *) Test the memory use on the R side: ...

5

I don't know what causes the issue (which looks like a bug to me), but I generally find the best way to deal with exerting control over Import not doing quit the right thing with HTML is to use the "XMLObject" element and use ordinary Mathematica functions on it, like so: In[1]:= ImportString@ ExportString[ ...

4

So, as we can see here So if the dataset name contains one of those characters, it needs to be escaped. Try this, replacing "~/Downloads/" with "D:\...\" for the file elementlist = StringReplace[#, "." -> "\\."] & /@ Import["~/Downloads/EVE_L3_merged_1nm_2015323_005.nc", "Datasets"] (* {"PRIMARY", "PRIMARY_HEAD", "LINESMETA_HEADER", \ ...

3

Looks like you are looking for the Dataset format. Using "ExampleData/elements.xls" to get an example .xls file: ds = SemanticImport["ExampleData/elements.xls"] Now ds[1] and ds[All, "Name"]

3

Let's assume your excel sheet has three columns with headings Oct through Dez. Import it imp = Catenate @ Import["excel.xlsx"] {{"Okt", "Nov", "Dez"}, {10., 11., 12.}, {1., 2., 3.}} The Catenate is necessary to remove the outermost brackets. Get header head = imp[[1]] {"Okt", "Nov", "Dez"} Get values vals = imp[[2 ;;]] {{10., 11., ...

3

The problem is a case of the starting values (1.0 for both parameters) being too far away from the solution. (And you should avoid uppercase letters for variable names.) The following works: model1 = FindFit[j, m/(1 + Exp[po + r t]), {{m, 500}, {r, -0.008}}, t] (* {m -> 527.775, r -> -0.00797179} *) Alternatively, a better long-term approach is to ...

2

The blanks need to be %20 in a url: Import["https://files.datapress.com/london/dataset/cis-commissioned-2011-census-tables/2015-11-16T13:32:06/CT0060%20-%20Passports%20held%20(detailed).xls"] "{ {"Office for National Statistics"}, {""}, {"CT0060 - Passports held (detailed)"} } ..

2

It might well be possible to use the stream methods functionality for that, but I think it is not exactly what they were made for. You probably can achieve what you want as easy as this (there might be more efficient ways to turn the string that Read returns into a list of integers/numbers): stream = StringToStream["1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 2, 10, ...

2

jSoupLink can be used as a workaround, like this: << jSoupLink html2text[html_] := First@jSoupLink`ParseHTMLFragment[ "<div id=\"container\">" <> html <> "</div>", "#container", "text" ] html2text["a<span>b</span>c"] (* Out: abc *) html2text["a<foo>b</foo>c"] (* Out: abc *)

2

Try this: lst = {{"", "", "EE", "EE", "EE", "EE", "EE"}, {"", "", "Agriculture", "Forestry", "Fishing", "Mining ", "Extraction "}, {"EE", "Agriculture", "0,131346361", "0,01587348", "0,003638642", "8,36E-004", "1,67E-004"}, {"EE", "Forestry", "5,52E-004", "0,155865778", "4,38E-005", "6,00E-004", "4,00E-005"}, {"EE", "Fishing", ...

1

According to the Documentation page for PDF format (under the "Options" section) there is "TextOutlines" option which controls "whether to import characters as outlines". You should set it to False for importing text as characters instead of outlines: Import["test.pdf", "TextOutlines" -> False] Note that this feature can work incorrectly when ...

1

Alexei's answer is great, but I think you could make it easier to grab a column by the label, creating a custom function to do this. Firstly though, perhaps you want to import the data as numbers, so that you can perform operations on them. I notice that all the elements after the third row and the third column are in a numeric format where the comma is ...

1

Here the code for an example table (please provide copyable example data next time you post a question): m= {{"", "", "EE", "EE", "EE", "EE", "EE"}, {"", "", "Agriculture", "Forestry", "Fishing", "Mining", "Extraction"}, {"EE", "Agriculture", 5.5646, 1.08922, 7.83459, 7.37088, 4.69533}, {"EE", "Forestry", 7.02039, 0.839213, 4.81989, 6.74534, ...

1

I think this can be just simplified. You could relabel vertices if you wish (and make into function): tab = Import["http://algs4.cs.princeton.edu/44sp/mediumEWD.txt", "Table"]; gd = Drop[tab, 2]; g = Graph[DirectedEdge @@@ gd[[All, {1, 2}]], EdgeWeight -> gd[[All, 3]]] Checking weights: (# -> PropertyValue[{g, #}, EdgeWeight] & /@ ...

1

One can import raw text and use this example to remove HTML tags StringReplace[ #, "<" ~~ Except[">"] .. ~~ ">" -> ""] &@ ImportString["a<bar>b</bar>c", {"HTML", "Source"}] (* "abc" *)

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