Hot answers tagged

12

Go to a new cell in a notebook and write "=", this will create an orange equality sign in the beginning of the cell. This means that you have entered the free form input mode. Write the name of a food item or a type of food and evaluate the cell, Mathematica will then return the entity corresponding to that food item or food type. You can hover the entity to ...


11

The date is different because Wolfram Alpha is wrong about when the Battle of Agincourt took place. Alpha is returning 25 October 1415 in the Gregorian calendar as the date of the battle, but the battle took place on that date in the Julian calendar (the calendar in use at the time). That date corresponds 3 November 1415 in the proleptic Gregorian ...


10

Here's something to get you started down to path of scraping the somewhat larger individual pictures from the Nobel website: links = Import[ "https://www.nobelprize.org/nobel_prizes/physics/laureates/index.html?images=yes", "Hyperlinks"]; individualpagelinks = Select[ links, StringMatchQ[ "https://www.nobelprize.org/nobel_prizes/physics/...


10

For large enough bounds, NSum is used. Compare timings: NSum[(-1)^(n + 1)/n, {n, 1, 100000}] // AbsoluteTiming {0.004744, 0.693142 - 1.3494*10^-16 I} N[Sum[(-1)^(n + 1)/n, {n, 1, 100000}]] // AbsoluteTiming {1.84727, 0.693142}


9

Here's a start.... x = "healed"; y = "pay"; Intersection[ WolframAlpha["synonyms of " <> y, {{"Synonyms:WordData", 1}, "ComputableData"}, InputAssumptions -> {"*MC.%7E-_*WordData-"}], WolframAlpha["rhymes with " <> x, {{"Rhyme:WordData", 1}, "ComputableData"}, PodStates -> {"Rhyme:WordData__More"}, InputAssumptions -> {"*MC.%7E-_*...


9

I remember from last years conference (Wolfram Technology Conference 2015) that there was a presentation on food entities. It doesn't seem to have been recorded but you can get the presentation (Food in the Wolfram Language). It shows a great deal on how to access foods and gives details on some of their properties. The food data is somewhat deep and very ...


6

It doesn't seem there is a one line solution but we can adapt W|A to give a result similar to DSolve and friends. fSolve[eq_Equal] := fSolve @ ToString@eq; fSolve[eq_String] := Values[ WolframAlpha[ "solve " <> eq, {"SolutionAsAFunctionalEquation", "FormulaData"} ] ] /. Hold[Equal[f_, d_]] :> f -> d /. { Subscript[\[ScriptC], n_] :> ...


5

Facebook has deprecated the API that Mathematica relied on to gather this information. Official source.


5

Your input should be: Series[ (I x + y Exp[I p]) Tanh[Pi (I x + y Exp[I p])] Log[(I x + y Exp[I*p])^2 + a^2] I y Exp[I p], {y, 0, 2}, Assumptions -> {x > 0, y > 0, a > 0, p ∈ Reals} ] Asterisks can be used for multiplication, but a space is more usual. I removed unnecessary parentheses. The more important points are all functions (Exp, ...


5

Case closed but the topic should be left here for future visitors who use V9. So: Bug introduced in 9.0 and fixed in 10.0.0


5

Something like this perhaps? bibOriginal = Import["http://www.gutenberg.org/cache/epub/10/pg10.txt"]; (* load the bible *) bib = StringDrop[bibOriginal, 658]; (* drop the introductory text *) bib = StringDrop[bib, -18733];(* drop the legalistic closeout at the end*) bibC = Map[{#[[1]], Length[#]} &, Gather[Sort[ToLowerCase[Characters[bib]]]]]; bibC = ...


4

I will start by just copying how Jason B imported the bible: bible = Import["http://www.gutenberg.org/cache/epub/10/pg10.txt"]; bible = StringSplit[bible, { "*** START OF THIS PROJECT GUTENBERG EBOOK THE KING JAMES BIBLE \ ***", "*** END OF THIS PROJECT GUTENBERG EBOOK THE KING JAMES BIBLE ***" }][[2]]; After that I will use WordCounts and ...


4

We can import the bible directly from the web and convert it to a list of words fairly easily. Here I'm going to remove the chapter/verse headings as well as extraneous punctuation marks. biblewords = Import["http://www.gutenberg.org/cache/epub/10/pg10.txt"] // StringSplit[#, {"*** START OF THIS PROJECT GUTENBERG EBOOK THE KING JAMES BIBLE ***...


4

You can import the prices from the Energy Information Administration. RCLC1d = Import["http://www.eia.gov/dnav/pet/hist_xls/RCLC1d.xls"]; c1 = RCLC1d[[2, All, {1, 2}]]; c1prices = Cases[Drop[c1, 3], {_, _?NumberQ}]; DateListPlot[c1prices, Joined -> True, PlotLabel -> "WTI Oil Price since " <> DateString[ c1prices[[1, 1]], {"Day", " ", ...


4

This is a documentation oversight. The function FlightData is not available in Mathematica as of this time.


4

This =Solve[64((x-Sqrt[x^2-1])/(x+1))^2-25(1-Sqrt[x-1]/(x+1))^2+9==0, x] and this WolframAlpha["Solve[64((x-Sqrt[x^2-1])/(x+1))^2-25(1-Sqrt[x-1]/(x+1))^2+9==0,x]"‌​] solve immediately. Note: One reason for using WolframAlpha to handle some calculations is that you can sometimes see the steps involved, see additional information, make use of curated ...


4

Using jSoupLink: << jSoupLink` ParseHTML[ "https://www.nobelprize.org/nobel_prizes/physics/laureates/1921/einstein-facts.html", ".laureate_info_wrapper p", "text" ] // TableForm It is possible to be more precise: ParseHTML[ "https://www.nobelprize.org/nobel_prizes/physics/laureates/1921/einstein-facts.html", "span[itemprop=birthDate]", ...


3

Based on the documentation, I would say that this is a bug. Note, however, that you can perhaps get at the data you want via the call EntityValue[Entity["Country", "UnitedStates"], EntityProperty["Country", "ElectricityTotal", "Date" -> 2007]] though the relationship between "ElectricityTotal" and "ElectricityProduction" is less than clear. I would ...


3

So the data you want is here: WolframAlpha["p/e msft 1/3/2000 to 6/1/2000"] How can it be accessed? Assuming you want the data from the plot, you need to see what the name of the pod you are interested is, WolframAlpha["p/e msft 1/3/2000 to 6/1/2000", "PodIDs"] (* {"Input", "Result", "DateRangeSpecified:PriceEarningsRatio:FinancialData"} *) That ...


2

I've found the answer! Turns out the PodState has to be: {"[PodName]__Step-by-step solution"} And the second argument to WolframAlpha has to be: {{"[Podname]", 2}, "Content"} If you have a 1 there instead of a 2, it will just show the answer and not the steps. So, all in all, the function: ShowSteps[str_, find_: "Result", num_: 2] := WolframAlpha[...


2

Thanks to MarcoB and C. E. From them I learned how to deal with HTML contents using Mathematica. I now summerize my final approach below (it is a bit long, so I make it an answer). In this approach, I use information all from www.nobelprize.org and mathematica features that are all built-in. individualpagelinks is a list of all Nobel Laureates ...


2

I just tried it, it works on Alpha as is. It just did not like the Exclusions -> None but it still took it. Most of the times, Wolfram Mathematica language will also work in Wolfram Alpha as well. I like to think of it as the Wolfram Alpha language being an almost superset of the Wolfram Mathematica language. Plot[Piecewise[{{10*x - 0.5*5*x^2, 0 < x &...


2

Perhaps this unsophisticated attempt is a starting point. whales = {"have hair", "live birth", "breathe air", "live in water", "have fins", "can swim"}; fish = {"lay eggs", "have scales", "breathe water", "live in water", "have fins", "can swim"}; tint = Intersection[whales, fish]; w = Complement[whales, tint]; f = Complement[fish, tint]; r1 = Disk[{...


1

Edit, still the lazy way: Go the lazy way and try the folling


1

This answer suggested by @Hubble07 works. subsetQ[list1_, list2_] := WolframAlpha[ "is " <> ToString[list1] <> "a subset of " <> ToString[list2], {{"Result", 1}, "ComputableData"}]


1

It looks like you're crossing types of input For Me, '=' and ctl + '=' return no pod, just an entity- and '==' always returns a pod.


1

I found that wolfram|Alpha wasn't good enough, by RhymeZone is a great site for this, and they even support near rhymes. Here's an example: Rhymes[r_] := Rhymes[r] = Module[{url, links, rhy}, url=StringTemplate["http://www.rhymezone.com/r/rhyme.cgi?Word=`1`&typeofrhyme=perfect&org1=syl&org2=l&org3=y"][r]; Check[links=Import[url,"...



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