Wolfram Language

Use Day Specification in Time Series Operations

In the Wolfram Language there are two specific functions that allow you to directly take a selection of a time series based on the criterion involving its time stamps: TimeSeriesResample and TimeSeriesWindow. Beginning with Version 12, this selection criterion can be given using day specification, like "BusinessDay" or Monday.

Resample time series with day specification.    

Select weekends using TimeSeriesResample.

Check that new time series has only weekend time stamps.

Use TimeSeriesWindow to take a subset of the time series with time stamps being selected day of the week.

Apply this functionality to financial data of stock prices.

Find the prices at the end of each month.

Now find the number of trading days in each month.

Related Examples

de es fr ja pt-br zh