New answers tagged

5

We can operate upon data contained within dataset by applying query operators. Assume that the dataset described in the question has been assigned to the variable ds. Then, for example, we can convert the embedded association into an event series by applying the EventSeries operator: ds[EventSeries] Alternatively, we could produce a plot by composing ...


3

Dataset has only been around since version 10.0, and not all functions support it as yet. However, Association has much broader support and is what Dataset is based on. You can use Normal to convert the Dataset into an Association. EventSeries can work with associations. With ds as the Dataset in the above post, then EventSeries[Normal@ds] (* ...


1

You can reformat the absolute very easily and you have almost any format that you want. Look at DateString for the large range of date and time element formats available. Here is a function that will handle your data. toDateString[{arg1_, arg2_}, fmt_] := {DateString[arg1, fmt], arg2} Examples With[{ item = {3538468800, 6738.89}, fmt = {"...


2

ts = FinancialData["NYSE:GS", "Price", {{2012, 1, 1}, {2013, 1, 1}}]; total = TimeSeriesAggregate[ts, "Quarter", Total]; Note that you need ts rather than data in definition of total (total2 = MapAt[DateString[#, {"MonthNameShort", "-", "YearShort"}] &@* DateList, total, {All, 1}]) // Grid


2

rawData = {{"13/12/2010", 10}, {"15/12/2010", 20}, {"17/12/2010", 30}, {"19/12/2010", 40}, {"21/12/2010", 50}, {"23/12/2010", 60}, {"13/12/2011", 80}, {"15/12/2011", 70}, {"17/12/2011", 60}, {"19/12/2011", 40}, {"21/12/2011", 50}, {"23/12/2011", 60}, {"13/12/2012", 10}, {"15/12/2012", 20}, {"17/12/2012", 30}, {"19/12/2012", 20}, {"21/12/2012", ...


2

(data = {{Date, Price}, {"16/05/2007", 3655}, {"16/06/2007", 3435}, {"16/07/2007", 3528}}) // Grid (data2 = MapAt[DateList[{#, {"Day", "Month", "Year"}}] &, data, {2 ;;, 1}]) // Grid


0

not sure why I cannot comment, so I'm going to write here. @JasonB, I made the following oversations: the method of setting timezone using SetOptions has no effect on the date-value paris returned. For my query the first timepoint is "Thu 21 Jul 2016 09:51:00" - 20C and the last is "Fri 22 Jul 2016 11:51:00" - 21C. It's the same no matter how I set ...


4

This should change the Hour to 18: do = DateObject[{2016, 7, 17, 0, 0}] DateObject[do, {18, 0, 0}] This slightly abridged syntax works as well: DateObject[do, {18}]


6

A slight modification of your strategy ought to work: DateObject[{2016, 7, 17, 0, 0}] /. _TimeObject -> TimeObject[{18, 0, 0}]


2

As far as I am aware, AbsoluteTiming[] gives only answers in seconds, so you need to do this manually MapAt[UnitConvert[# Quantity["Seconds"], "Minutes"] &, AbsoluteTiming[g[x_, t_] := Sin[x]^90*(1 + t^2); Integrate[g[x, \[Tau]], {\[Tau], 0, t}]], 1] {Quantity[0.000146967, "Minutes"], t Sin[x]^90 + 1/3 t^3 Sin[x]^90}



Top 50 recent answers are included