42

a=Most@Sort[StarData[ EntityClass["Star", "StarNearest10"], {"Name", "DistanceFromSun"}], #1[[2]] < #2[[2]] &] (*{{"Proxima Centauri", Quantity[4.2181, "LightYears"]}, {"Rigel Kentaurus A", Quantity[4.38982, "LightYears"]}, {"Rigel Kentaurus B", Quantity[4.4001, "LightYears"]}, {"Barnard's Star", Quantity[5.9339, "...


41

It took me quite a while, but finally, here's a visualization of the perigee of Flamsteed's comet: I should first note two things: first, some of the needed data for computing the orbit of comet C/1683 O1 was missing in AstronomicalData["CometC1683O1", "Properties"], and I had to pull information from external sources to supplement the information available;...


38

Well, let me try to answer the OP's question. And thanks MMA.SE, for reopening this interesting question! DATA To answer this question, you have to get the data using Mathematica's FinancialData function. This was the only thing originally done by the OP! First step: define which stocks will be included in the portfolio: Portfolio = {"AAPL", "BA", "IBM",...


29

There are system options available that should restore the old behavior for most of the currated data paclet: SetSystemOptions[SystemOptions["DataOptions"] /. True -> False] {"DataOptions" -> {"ReturnEntities" -> False, "ReturnQuantities" -> False, "UseDataWrappers" -> False}} Note that this prevents these paclets from returning Entity,...


28

Preload all chemical data: ChemicalData[All, "Preload"]; RebuildPacletData[]; (* the latter should not really be necessary *) Get all names: cd = ChemicalData[]; Get their molecular formulae: l = ChemicalData[#, "MolecularFormulaString"] & /@ cd; By counting the Cs, Os and Hs in the tattooed diagram we know we have to find $\rm{C_{19}H_{28}O_{2}}$. ...


27

Update: Template Notebook I finally got around to finishing my curated data template notebook. You can see it here Currently it only supports single-type data paclets, but a template for multi-type curated data is in the works and I'll test that with my accumulated Stack Exchange data. In the meantime, I took some arbitrary airline safety data and turned ...


26

The following is a little involved, but it calculates the "minimum displacement" evolution by choosing the least total displacement alternatives from the permutations generated by the "AutomorphismGroup" of the graph: {n, edges, coords1, perms} = GraphData["PappusGraph", {"VertexCount", "EdgeList", "...


23

You can get some nice vector playing cards from this site, licensed under GNU LGPL (read more here). Download this folder to your computer and then try the following: (* replace with your download dir *) files = Flatten@With[{dir = "~/Downloads/Chrome/mma/SVG_and_EPS_Vector_Playing_Cards_Version_1.3/EPS_Vector_Playing_Cards_Version_1.3/52-Individual-Vector-...


23

You can use your ContourPlot, you just need to wrap coordinates with GeoPosition, note that you have to flip order. (if x is longitude and y is latitude, because GeoPosition assumes first is latitude and so on.) cp is Graphics[GraphicsComplex[coordinates, primitives]...], it is convenient to use this form. We can apply GeoPosition in one place and reduce ...


21

The discussion in this answer pertains to older versions of Mathematica which had low-resolution bitmaps of country flags. In my current version (11), the flags now are very detailed vector graphics, making the below superfluous. Introduction Your (paraphrased) question was "Why do some of the CountryData flags render so badly?". I take the liberty to ...


21

One key function you might need is the (undocumented) function Graphics`Mesh`InPolygonQ[], which tests if a point is inside a given polygon. With it, and a few other tweaks, here's my version of weatherMap[]: weatherMap[region_String, property_String, res_Integer: 25, opts___] := Module[{fmin, cmax, coords, pts, minLong, maxLong, minLat, maxLat, ...


21

apple = Interpreter["Company"]["Apple"]["Image"] Interpreter["Company"]["GE"]["Image"] Also works for the continent and respects colours: Interpreter["Company"]["Siemens"]["Image"] Update Interpreter["Company"]["Wolfram"]["Image"] For Apple addicts: ImageFilter[Max[Flatten[#]] - Min[Flatten[#]] &, ImagePad[Last@MapThread[ImageMultiply, {...


20

After downloading and unpacking the stanford Part-Of-Speech tagger that @PlatoManiac mentioned it is easy to call it with JLink: $POSTaggerPath = "/some/where/stanford-postagger-2013-11-12/"; << JLink` AddToClassPath[$POSTaggerPath]; tagString[str_String] := JavaBlock[ Module[{tagger}, LoadJavaClass["edu.stanford.nlp.tagger.maxent.MaxentTagger"]...


20

portf = {"AAPL", "BA", "IBM", "BMW.DE", "DIS", "R", "PEP", "BRBY.L", "AXP", "BTI"}; prices = FinancialData[#, "Price", {{2004}, {2011}, "Month"}] & /@ portf; Returns are often calculated as the difference of the logarithms of the prices: Differences[Log@#] &[prices[[1, All, 2]]] This works because $\log(\text{price}_{new})-\log(\text{price}_{old})...


20

This is a long comment for Nick Lariviere's answer. You can use Trace to see how lengthy the entity and quantity logic is. Version 9: Tuples@{Range@112, {"Symbol", "Group"}} // First ElementData @@ % // Trace; % // ByteCount 78336 TreeForm[%%, VertexLabeling -> False, ImageSize -> 800, AspectRatio -> 2] Version 10: ... % // ByteCount ...


19

Not super high quality, but this might do for some purposes: cards = Join[ Table[ToString[k], {k, 2, 10}], {"Jack", "Queen", "King", "Ace"}]; suits = {"hearts", "diamonds", "clubs", "spades"}; deck = Flatten[Outer[#2 <> " of " <> #1 &, suits, cards]]; images = Table[ WolframAlpha[card, {{"Image", 1}, "Content"}], {card, deck}]; Grid[...


19

Stars RA and Dec for stars can be fetched via StarData["Sirius", {"RightAscension", "Declination"}] (* -> {6 h, 45 m, 9.3 s, -16 degrees, -42 arc minutes, -47.2 arc seconds} *) Although one can specify a particular date and time for these coordinates, the result Mathematica gives does not actually depend on the date or time at all - an indication that ...


18

It is a nice application for the Graph[] features in Mma. We can calculate quickly all possible decays for all known isotopes, and then let VertexComponent[] look for the chains ending in {"Iridium191", "Iridium193"}. g = Graph@Union@Flatten[Thread[DirectedEdge @@ ##] & /@ Select[{#, IsotopeData[#, "DaughterNuclides"]} & /@ IsotopeData[], #[...


18

This is a matter of rules ordering for CountryData definitions. You have to do something like this: Unprotect[CountryData]; CountryData[c_String, "MyProperty"] := 0; (*actually call to another function*) DownValues[CountryData] = RotateRight[DownValues[CountryData]]; Protect[CountryData]; This reorders the definitions so that yours is at the top (or close ...


18

All the information is there, but to adjust the sphere radius I had to do a replacement as follows: spaceFilledPlot[latticeType_] := LatticeData[latticeType, "Image"] /. Sphere[pt_, r_] :> {Opacity[.5], Sphere[pt, LatticeData[latticeType, "PackingRadius"]]} spaceFilledPlot["FaceCenteredCubic"] I added the opacity for better visibility of the ...


17

I separated this project into two parts. The first is to compute the coordinates of the Geohash location. (*Grab the user's geographical location. The location is based on IP address, so it may not be completely accurate. It's usually good enough to get your graticute. You can replace home with with known coordinates in the form {hx, hy} if you like.*) home ...


17

Perhaps naïve: Norm@AstronomicalData["Jupiter", "Position"] (* 7.74204*10^11 edit .... copy/paste error corrected *) Checking some consistence EuclideanDistance @@ (AstronomicalData[#, "Position"] & /@ {"Earth", "Jupiter"}) == AstronomicalData["Jupiter", "Distance"] (* True *)


17

I guess you're hoping to take data produced by Mathematica via commands like CountryData and CityData and display that data on a map of some type. From your question, it's honestly not totally clear if you'd prefer an in notebook solution or a completely separate Google Map but both are possible. A static map in notebook In order to display your points as ...


17

myAtoms = {"H", "Li", "Na"}; defCols = myAtoms /. ColorData["Atoms", "ColorRules"]; newCols = {Pink, Yellow, LightBlue}; ColorData["Atoms", "Panel"] /. Thread[defCols -> newCols] Edit: Changing the font color isn't related to the ColorRules, but to the special formatting used by the Panel. So it's cumbersome, but you can see that Mma uses a similar ...


16

Offered as an alternative to getting the same information and a check on it, one can also get this measurement from a WolframAlpha query: ... Of some interest, by these measurements Jupiter appears to have moved quite a ways further from the Sun since belisarius's answer just some 11 hours ago. 67.74204*10^11 vs 7.74232*10^11 WolframAlpha can also give ...


16

One of the new operations on TimeSeries objects is TimeSeriesWindow. I think it does what you need. ts = WeatherData["KP60", "Temperature", {{2013, 7, 1}, {2013, 9, 30}}]; DateListPlot[TimeSeriesWindow[ts, {{2013, 8, 1}, {2013, 8, 14}}]]


16

Another variation: SemanticInterpretation["AAPL Logo"] This method is nice because you can do at once: logos = SemanticInterpretation["AAPL, TSLA, GE and MSFT Logos"]; Column[logos, Frame -> All, FrameStyle -> Directive[Red, Thick]]


16

I've struggled with How Mathematica expects the end-user to interact with knowledge databases for quite some time. While this solution is likely not universal, it has been reasonably successful for many of my searches. Using CTRL= to perform a free-form Wolfram Language input followed by using CanonicalName typically provides the appropriate string to ...


16

Building off the other answer, CountryData has the data for the time zones for each country, as well as their population. So we can split each country proportionally into its individual timezones: countries = CountryData[]; populations = CountryData[#, "Population"] & /@ countries; timeZones = CountryData[#, "TimeZones"] & /@ countries; data = ...


15

As comments have stated, in most cases FindGeoLocation (and in turn other functions based on your geographical localization) use a so-called GeoIP service (similar to, e.g., this one) to determine to some extent your localization. This can be confirmed by using Trace on FindGeoLocation, which shows that Mathematica calls home to a Wolfram server for this ...


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