处理时间范围重叠的方法,用于调度、税收和物理应用程序。
time-range的Python项目详细描述
===
时间范围
==
…图片::https://img.shields.io/pypi/v/time\u range.svg
:目标:https://pypi.python.org/pypi/time\u range
图片::https://img.shields.io/travis/tunnell/time廑range.svg
:目标:https://travis ci.org/tunnell/time廑range
…图片::https://readthedocs.org/projects/time-range/badge/?version=latest
:目标:https://time-range.readthedocs.io/en/latest/?徽章=最新
:alt:文档状态
…图像::https://pyup.io/repos/github/tunnell/time-urange/shield.svg
:目标:https://pyup.io/repos/github/tunnell/time-urange/
:alt:updates
图片::https://pyup.io/repos/github/tunnell/time-range/python-3-shield.svg
:目标:https://pyup.io/repos/github/tunnell/time-range/
:alt:python 3
图片::https://api.codacy.com/project/badge/grade/54ccc5b06b2baade214ad0da62ac4
:alt:codacy badge
:target:https://app.codacy.com/app/tunnell/time_range?utm_u source=github.com&utm_u medium=referral&utm_u content=tunnell/time_u range&utm_u campaign=badger
-范围。阅读docs.io.
教程代码::ipython3
import time_range as tr
代码::ipython3
year=2017
这是一个有序的列表,因此从列表中的下一个行程推断结束日期
。对于开始日期,第一个数字是
月,第二个是日,第三个是小时,以此类推。代码::ipython3
trips=({country':'nl','start':(1,1)},
{country':'es','start':(3,4,14,0)},
{country':'nl','start':(4,11,19,50)},
{country':'us','start':(5,22,12),'state':'nj',
{country':'us','start':(6,30,12,30),'状态':'tx'},
{'country':'us','start':(7,3,16,28),'state':'nj'})
确定您一年中的时间分布,如下所示,只需
个工作日:
。代码:ipython3
series=tr.time_distribution(trips=trips,year=2004)
解析文字:
工作日251.0
(nl,nl)73.0
(es,es)26.0
(us,nj)150.0
(us,tx)2.0
数据类型:float64
代码:ipython3
tr.fraction_of_year(trips=trips,year=2004,income=100000)
原始::html
<;div>;
<;style>;
。dataframe thead tr:only child th{
文本对齐:right;
}
。dataframe thead th{
文本对齐:left;
}
。dataframe tbody tr th{
垂直对齐:顶部;
}
<;/style>;
<;表格边框="1"class="dataframe">;
<;thead>;
<;tr style="text align:right;">;
<;th>;
<;th>;
<;th>;天<;th>;
<;th>;分形第n个工作日<;th>;
<;th>;收入<;th>;
<;tr>;
<;thead>;
<;tbody>;
<;tr>;
<;th>;工作日<;th>;
<;td>;251.0<;td>;
<;td>;1.000000<;td>;
<;td>;100000.000000<;td>;
<;tr>;
<;tr>;
<;th>;(nl,nl)<;th>;
<;td>;73.0<;td>;
<;td>;0.290837<;td>;
<;td>;29083.665339<;td>;
<;tr>;
<;tr>;
<;th>;(es)<;th>;
<;td>;26.0<;td>;
<;td>;0.103586<;td>;
<;td>;10358.565737<;td>;
<;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt&G公司t;
<;td>;2.0<;/td>;
<;td>;0.007968<;/td>;
<;td>;796.812749<;/td>;
<;/tr>;
<;/tbody>;
<;/table>;
<;/div>;
当年:
…代码:ipython3
tr.get_working_days(2013年)。head()
原始::html
<;div>;
<;style>;
。dataframe thead tr:only child th{
文本对齐:right;
}
。dataframe thead th{
文本对齐:left;
}
。dataframe tbody tr th{
垂直对齐:顶部;
}
<;style>;
<;表边框="1"class="dataframe">;
<;thead>;
<;tr style="text align:right;">;
<;th>;
<;th>;
<;th>;工作日
<;thead>;
<;tbody>;
<;tr>;
<;th>;2013-01-01<;th>;
<;td>;false<;td>;
<;tr>;
<;tr>;
<;tr>;
<;th>;2013-01-02<;th>;
<;td>;true<;td>;
<;tr>;
<;tr>;
<;th>;2013-01-03<;th>;
<;td>;真的<;td>;
<;tr>;
<;tr>;
<;th>;2013-01-04<;th>;
<;td>;真的<;td>;
<;tr>;
<;tr
<;lt;th>;2013-01-05;2013-01-01-05;lt;th>;
<;lt;td>;falslt;lt;lt;td>;
<;
<;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;br/><;lt;lt;lt;br/><;lt;br/>
>
>
<;该软件包是用cookiecuiecucucuiecuatecucuutr和t、t和t-cocookiecuiecuiecuitecuatecuutr和是的"audreyr/cookiecutter pypackage"项目模板。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` audreyr/cookiecutter pypackage`:https://github.com/audreyr/cookiecutter pypackage
==
=
=
历史
==
<0.3.0(2018-03-24)
----
*至少足够纳税。
<0.1.0(2018-02-11)
----
*pypi上的第一个版本。
时间范围
==
…图片::https://img.shields.io/pypi/v/time\u range.svg
:目标:https://pypi.python.org/pypi/time\u range
图片::https://img.shields.io/travis/tunnell/time廑range.svg
:目标:https://travis ci.org/tunnell/time廑range
…图片::https://readthedocs.org/projects/time-range/badge/?version=latest
:目标:https://time-range.readthedocs.io/en/latest/?徽章=最新
:alt:文档状态
…图像::https://pyup.io/repos/github/tunnell/time-urange/shield.svg
:目标:https://pyup.io/repos/github/tunnell/time-urange/
:alt:updates
图片::https://pyup.io/repos/github/tunnell/time-range/python-3-shield.svg
:目标:https://pyup.io/repos/github/tunnell/time-range/
:alt:python 3
图片::https://api.codacy.com/project/badge/grade/54ccc5b06b2baade214ad0da62ac4
:alt:codacy badge
:target:https://app.codacy.com/app/tunnell/time_range?utm_u source=github.com&utm_u medium=referral&utm_u content=tunnell/time_u range&utm_u campaign=badger
-范围。阅读docs.io.
教程代码::ipython3
import time_range as tr
代码::ipython3
year=2017
这是一个有序的列表,因此从列表中的下一个行程推断结束日期
。对于开始日期,第一个数字是
月,第二个是日,第三个是小时,以此类推。代码::ipython3
trips=({country':'nl','start':(1,1)},
{country':'es','start':(3,4,14,0)},
{country':'nl','start':(4,11,19,50)},
{country':'us','start':(5,22,12),'state':'nj',
{country':'us','start':(6,30,12,30),'状态':'tx'},
{'country':'us','start':(7,3,16,28),'state':'nj'})
确定您一年中的时间分布,如下所示,只需
个工作日:
。代码:ipython3
series=tr.time_distribution(trips=trips,year=2004)
解析文字:
工作日251.0
(nl,nl)73.0
(es,es)26.0
(us,nj)150.0
(us,tx)2.0
数据类型:float64
代码:ipython3
tr.fraction_of_year(trips=trips,year=2004,income=100000)
原始::html
<;div>;
<;style>;
。dataframe thead tr:only child th{
文本对齐:right;
}
。dataframe thead th{
文本对齐:left;
}
。dataframe tbody tr th{
垂直对齐:顶部;
}
<;/style>;
<;表格边框="1"class="dataframe">;
<;thead>;
<;tr style="text align:right;">;
<;th>;
<;th>;
<;th>;天<;th>;
<;th>;分形第n个工作日<;th>;
<;th>;收入<;th>;
<;tr>;
<;thead>;
<;tbody>;
<;tr>;
<;th>;工作日<;th>;
<;td>;251.0<;td>;
<;td>;1.000000<;td>;
<;td>;100000.000000<;td>;
<;tr>;
<;tr>;
<;th>;(nl,nl)<;th>;
<;td>;73.0<;td>;
<;td>;0.290837<;td>;
<;td>;29083.665339<;td>;
<;tr>;
<;tr>;
<;th>;(es)<;th>;
<;td>;26.0<;td>;
<;td>;0.103586<;td>;
<;td>;10358.565737<;td>;
<;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt&G公司t;
<;td>;2.0<;/td>;
<;td>;0.007968<;/td>;
<;td>;796.812749<;/td>;
<;/tr>;
<;/tbody>;
<;/table>;
<;/div>;
当年:
…代码:ipython3
tr.get_working_days(2013年)。head()
原始::html
<;div>;
<;style>;
。dataframe thead tr:only child th{
文本对齐:right;
}
。dataframe thead th{
文本对齐:left;
}
。dataframe tbody tr th{
垂直对齐:顶部;
}
<;style>;
<;表边框="1"class="dataframe">;
<;thead>;
<;tr style="text align:right;">;
<;th>;
<;th>;
<;th>;工作日
<;thead>;
<;tbody>;
<;tr>;
<;th>;2013-01-01<;th>;
<;td>;false<;td>;
<;tr>;
<;tr>;
<;tr>;
<;th>;2013-01-02<;th>;
<;td>;true<;td>;
<;tr>;
<;tr>;
<;th>;2013-01-03<;th>;
<;td>;真的<;td>;
<;tr>;
<;tr>;
<;th>;2013-01-04<;th>;
<;td>;真的<;td>;
<;tr>;
<;tr
<;lt;th>;2013-01-05;2013-01-01-05;lt;th>;
<;lt;td>;falslt;lt;lt;td>;
<;
<;lt;lt;lt;lt;lt;lt;lt;lt;lt;lt;br/><;lt;lt;lt;br/><;lt;br/>
>
>
<;该软件包是用cookiecuiecucucuiecuatecucuutr和t、t和t-cocookiecuiecuiecuitecuatecuutr和是的"audreyr/cookiecutter pypackage"项目模板。_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` audreyr/cookiecutter pypackage`:https://github.com/audreyr/cookiecutter pypackage
==
=
=
历史
==
<0.3.0(2018-03-24)
----
*至少足够纳税。
<0.1.0(2018-02-11)
----
*pypi上的第一个版本。