Tag Info

New answers tagged

3

Use Map, not Thread. data = StringSplit["a test string"]; WordData[#, "PartsOfSpeech"] & /@ data {{"Noun", "Preposition", "Determiner"}, {"Noun", "Verb"}, {"Noun", "Verb"}} WordData[#, "PartsOfSpeech"] & /@ Rest @ data {{"Noun", "Verb"}, {"Noun", "Verb"}} The reason Thread doesn't work for {"test", "string"} is that WordData interprets a ...


2

This is due to the fact that the first data point pulled (for {2014,8,14}) is used to calculate the first return value, which is on {2014,8,15}. To calculate the return for {2014,8,14} the previous day is needed. In order to get matching starting dates in a reliable way, it is best to determine the starting date, e.g. firstDate={2014, 01, 05} and than ...


0

This will find the temperature at each of the weather stations:- stations = WeatherData[{"Chicago", 3}] {"C3175", "KCGX", "C8163"} WeatherData[# , "Temperature"] & /@ stations {23.3, 14., 2.8} P.S. WeatherData["Chicago", "Temperature"] 23. Works ok, but it might be more reliable to use the nearest weather station.


1

{meanhumidity, meantemp} = WeatherData["London", #, {{2007, 1, 1}, {2007, 12, 31}, "Day"}] & /@ { "MeanHumidity", "MeanTemperature"}; plotdata = Transpose[{meanhumidity[[;; -2, 2]], meantemp[[2 ;;, 2]]}]; ListPlot[plotdata, Frame -> True, FrameLabel -> {"Mean Humidity [t-1]", "Mean Temp [t]"}]


3

You did not state that you wished to avoid making additional assignments upon a System` Symbol, therefore that is a natural approach and it is possible using Unprotect since ElementData is not Locked, and it appears to work correctly here: Unprotect[ElementData]; ElementData["Carbon", "Resonance"] = 42; ElementData["Phlebotinum", "AtomicWeight"] = 666; ...


0

The Wolfram '.wdx' format was made for this. It maintains wolfram code in a file, but only code, unlike a notebook. Read up here for more info. The first two lines stay the same, then you would export the data as so: Export["smokers.wdx", table]; This creates a file in MyDocuments (if in windows, otherwise the folder above where your notebooks are ...


3

Have you tried this link? It lets you select the country and date range. After the table is displayed, I just selected the values I wanted (highlighted yellow in the picture below), and paste it to MMA using ImportString to let MMA parse it. pasted = ImportString["paste it here"]; Short[pasted, 5] Then I did some processing to remove the {, , , ..} ...


8

Download the data (csv file) from U.S. Energy Information Administration; http://www.eia.gov/countries/country-data.cfm?fips=uk data = Import[ "/Users/hanlonr/Downloads/United_Kingdom_proved_Reserves_(1980-2014).csv"];\ ListLinePlot[data[[5 ;; -6]], Frame -> True, Axes -> False, PlotRange -> All, PlotLabel -> StringReplace[data[[1, ...


3

As @Mr.Wizard asked, "...it's time for an answer, don't you think?". I forgot about this question, but after year it occurred to me to formulate an answer following @LeonidShifin suggestions: First get some test data: testData = FinancialData["GE", "Jan. 1, 2000"][[1 ;; 10]]; dataFile = "/Users/jagra/Data.test.csv"; Export[dataFile, testData, "CSV"]; ...


1

More of a long comment... You can easily write a function that will enable your end users to Import data from your custom backend. customData[param1_]:= Import[...] customData[param1_, param2_]:= Import[...] customData[param1_, param2_, param3_]:= Import[...] Using different parameter sets in your function definition can give you all the kinds of ...



Top 50 recent answers are included