daru

https://github.com/sciruby/daru

Ruby

Data Analysis in RUby

Daru::DateTimeIndex.date_range

Create a date range by specifying the start, end, periods and frequency
of the data.

== Notes

If you specify :start and :end options as strings, they can be complete or
partial dates and daru will intelligently infer the date from the string
directly. However, note that the date-like string must be in the format
`YYYY-MM-DD HH:MM:SS`.

The string aliases supported by the :freq option are as follows:

* 'S'     - seconds
* 'M'     - minutes
* 'H'     - hours
* 'D'     - days
* 'W'     - Week (default) anchored on sunday
* 'W-SUN' - Same as 'W'
* 'W-MON' - Week anchored on monday
* 'W-TUE' - Week anchored on tuesday
* 'W-WED' - Week anchored on wednesday
* 'W-THU' - Week anchored on thursday
* 'W-FRI' - Week anchored on friday
* 'W-SAT' - Week anchored on saturday
* 'MONTH' - Month
* 'YEAR'  - One year
* 'MB'    - month begin
* 'ME'    - month end
* 'YB'    - year begin
* 'YE'    - year end

Multiples of these can also be specified. For example '2S' for 2 seconds
or '2ME' for two month end offsets.

Currently the precision of DateTimeIndex is upto seconds only, though this
will improve in the future.

Source | Google | Stack overflow

Edit

git clone [email protected]:sciruby/daru.git

cd daru

open lib/daru/date_time/index.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Daru--DateTimeIndex-date_range-for-pr


# Commit to git

git add lib/daru/date_time/index.rbgit commit -m "better docs for Daru::DateTimeIndex.date_range"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Daru--DateTimeIndex-date_range-for-pr

hub pull-request


# Celebrate!