Python pandas.tseries.offsets.MonthBegin() Examples
The following are 8
code examples of pandas.tseries.offsets.MonthBegin().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pandas.tseries.offsets
, or try the search function
.
Example #1
Source File: test_frequencies.py From recruit with Apache License 2.0 | 5 votes |
def test_ms_vs_MS(): left = frequencies.get_offset('ms') right = frequencies.get_offset('MS') assert left == offsets.Milli() assert right == offsets.MonthBegin()
Example #2
Source File: test_frequencies.py From vnpy_crypto with MIT License | 5 votes |
def test_ms_vs_MS(): left = frequencies.get_offset('ms') right = frequencies.get_offset('MS') assert left == offsets.Milli() assert right == offsets.MonthBegin()
Example #3
Source File: test_frequencies.py From predictive-maintenance-using-machine-learning with Apache License 2.0 | 5 votes |
def test_ms_vs_MS(): left = frequencies.get_offset('ms') right = frequencies.get_offset('MS') assert left == offsets.Milli() assert right == offsets.MonthBegin()
Example #4
Source File: core.py From zipline-chinese with Apache License 2.0 | 5 votes |
def make_commodity_future_info(first_sid, root_symbols, years, month_codes=None): """ Make futures testing data that simulates the notice/expiration date behavior of physical commodities like oil. Parameters ---------- first_sid : int root_symbols : list[str] years : list[int] month_codes : dict[str -> int] Expiration dates are on the 20th of the month prior to the month code. Notice dates are are on the 20th two months prior to the month code. Start dates are one year before the contract month. See Also -------- make_future_info """ nineteen_days = pd.Timedelta(days=19) one_year = pd.Timedelta(days=365) return make_future_info( first_sid=first_sid, root_symbols=root_symbols, years=years, notice_date_func=lambda dt: dt - MonthBegin(2) + nineteen_days, expiration_date_func=lambda dt: dt - MonthBegin(1) + nineteen_days, start_date_func=lambda dt: dt - one_year, month_codes=month_codes, )
Example #5
Source File: synthetic.py From catalyst with Apache License 2.0 | 5 votes |
def make_commodity_future_info(first_sid, root_symbols, years, month_codes=None): """ Make futures testing data that simulates the notice/expiration date behavior of physical commodities like oil. Parameters ---------- first_sid : int root_symbols : list[str] years : list[int] month_codes : dict[str -> int] Expiration dates are on the 20th of the month prior to the month code. Notice dates are are on the 20th two months prior to the month code. Start dates are one year before the contract month. See Also -------- make_future_info """ nineteen_days = pd.Timedelta(days=19) one_year = pd.Timedelta(days=365) return make_future_info( first_sid=first_sid, root_symbols=root_symbols, years=years, notice_date_func=lambda dt: dt - MonthBegin(2) + nineteen_days, expiration_date_func=lambda dt: dt - MonthBegin(1) + nineteen_days, start_date_func=lambda dt: dt - one_year, month_codes=month_codes, )
Example #6
Source File: test_frequencies.py From elasticintel with GNU General Public License v3.0 | 5 votes |
def test_ms_vs_MS(): left = frequencies.get_offset('ms') right = frequencies.get_offset('MS') assert left == offsets.Milli() assert right == offsets.MonthBegin()
Example #7
Source File: test_frequencies.py From coffeegrindsize with MIT License | 5 votes |
def test_ms_vs_MS(): left = frequencies.get_offset('ms') right = frequencies.get_offset('MS') assert left == offsets.Milli() assert right == offsets.MonthBegin()
Example #8
Source File: test_frequencies.py From twitter-stock-recommendation with MIT License | 5 votes |
def test_ms_vs_MS(): left = frequencies.get_offset('ms') right = frequencies.get_offset('MS') assert left == offsets.Milli() assert right == offsets.MonthBegin()