Detail: SeriesHE: Accessor DatetimeΒΆ

Overview: SeriesHE: Accessor Datetime

SeriesHE.via_dt.year
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.year

Return the year of each element.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.year
<SeriesHE>
<Index>
a          1517
b          1517
c          1517
d          1517
e          1517
<<U1>      <int64>
SeriesHE.via_dt.year_month
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.year_month

Return the year and month of each element as string formatted YYYY-MM.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.year_month
<SeriesHE>
<Index>
a          1517-01
b          1517-04
c          1517-12
d          1517-06
e          1517-10
<<U1>      <<U7>
SeriesHE.via_dt.month
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.month

Return the month of each element, between 1 and 12 inclusive.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.month
<SeriesHE>
<Index>
a          1
b          4
c          12
d          6
e          10
<<U1>      <int64>
SeriesHE.via_dt.day
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.day

Return the day of each element, between 1 and the number of days in the given month of the given year.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.day
<SeriesHE>
<Index>
a          1
b          1
c          31
d          30
e          1
<<U1>      <int64>
SeriesHE.via_dt.hour
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.hour

Return the hour of each element, between 0 and 24.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.hour
<SeriesHE>
<Index>
a          0
b          0
c          0
d          0
e          0
<<U1>      <int64>
SeriesHE.via_dt.minute
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.minute

Return the minute of each element, between 0 and 60.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.minute
<SeriesHE>
<Index>
a          0
b          0
c          0
d          0
e          0
<<U1>      <int64>
SeriesHE.via_dt.second
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.second

Return the second of each element, between 0 and 60.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.second
<SeriesHE>
<Index>
a          0
b          0
c          0
d          0
e          0
<<U1>      <int64>
SeriesHE.via_dt.weekday
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.weekday()[source]

Return the day of the week as an integer, where Monday is 0 and Sunday is 6.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.weekday()
<SeriesHE>
<Index>
a          0
b          6
c          0
d          5
e          0
<<U1>      <int64>
SeriesHE.via_dt.quarter
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.quarter()[source]

Return the quarter of the year as an integer, where January through March is quarter 1.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.quarter()
<SeriesHE>
<Index>
a          1
b          2
c          4
d          2
e          4
<<U1>      <int64>
SeriesHE.via_dt.is_month_end
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.is_month_end()[source]

Return Boolean indicators if the day is the month end.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.is_month_end()
<SeriesHE>
<Index>
a          False
b          False
c          True
d          True
e          False
<<U1>      <bool>
SeriesHE.via_dt.is_month_start
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.is_month_start()[source]

Return Boolean indicators if the day is the month start.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.is_month_start()
<SeriesHE>
<Index>
a          True
b          True
c          False
d          False
e          True
<<U1>      <bool>
SeriesHE.via_dt.is_year_end
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.is_year_end()[source]

Return Boolean indicators if the day is the year end.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.is_year_end()
<SeriesHE>
<Index>
a          False
b          False
c          True
d          False
e          False
<<U1>      <bool>
SeriesHE.via_dt.is_year_start
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.is_year_start()[source]

Return Boolean indicators if the day is the year start.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.is_year_start()
<SeriesHE>
<Index>
a          True
b          False
c          False
d          False
e          False
<<U1>      <bool>
SeriesHE.via_dt.is_quarter_end
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.is_quarter_end()[source]

Return Boolean indicators if the day is the quarter end.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.is_quarter_end()
<SeriesHE>
<Index>
a          False
b          False
c          True
d          True
e          False
<<U1>      <bool>
SeriesHE.via_dt.is_quarter_start
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.is_quarter_start()[source]

Return Boolean indicators if the day is the quarter start.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.is_quarter_start()
<SeriesHE>
<Index>
a          True
b          True
c          False
d          False
e          True
<<U1>      <bool>
SeriesHE.via_dt.timetuple
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.timetuple()[source]

Return a time.struct_time such as returned by time.localtime().

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.timetuple()
<SeriesHE>
<Index>
a          time.struct_time(...
b          time.struct_time(...
c          time.struct_time(...
d          time.struct_time(...
e          time.struct_time(...
<<U1>      <object>
SeriesHE.via_dt.isoformat(sep, timespec)
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.isoformat(sep='T', timespec='auto')[source]

Return a string representing the date in ISO 8601 format, YYYY-MM-DD.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.isoformat()
<SeriesHE>
<Index>
a          1517-01-01
b          1517-04-01
c          1517-12-31
d          1517-06-30
e          1517-10-01
<<U1>      <<U10>
SeriesHE.via_dt.fromisoformat
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.fromisoformat()[source]

Return a datetime.date object from an ISO 8601 format.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'))
>>> s.via_dt.fromisoformat()
<SeriesHE>
<Index>
a          1517-01-01
b          1517-04-01
c          1517-12-31
d          1517-06-30
e          1517-10-01
<<U1>      <object>
SeriesHE.via_dt.strftime(format)
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.strftime(format)[source]

Return a string representing the date, controlled by an explicit format string.

>>> s = sf.SeriesHE(('1517-01-01', '1517-04-01', '1517-12-31', '1517-06-30', '1517-10-01'), index=('a', 'b', 'c', 'd', 'e'), dtype=np.datetime64)
>>> s.via_dt.strftime("%A | %B")
<SeriesHE>
<Index>
a          Monday | January
b          Sunday | April
c          Monday | December
d          Saturday | June
e          Monday | October
<<U1>      <<U17>
SeriesHE.via_dt.strptime(format)
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.strptime(format)[source]

Return a Python datetime object from parsing a string defined with format.

>>> s = sf.SeriesHE(('1/1/1517', '4/1/1517', '6/30/1517'), index=('a', 'b', 'c'))
>>> s.via_dt.strptime("%m/%d/%Y")
<SeriesHE>
<Index>
a          1517-01-01 00:00:00
b          1517-04-01 00:00:00
c          1517-06-30 00:00:00
<<U1>      <object>
SeriesHE.via_dt.strpdate(format)
SeriesHE.via_dt

Interface for applying datetime properties and methods to elements in this container.

InterfaceDatetime.strpdate(format)[source]

Return a Python date object from parsing a string defined with format.

>>> s = sf.SeriesHE(('1/1/1517', '4/1/1517', '6/30/1517'), index=('a', 'b', 'c'))
>>> s.via_dt.strpdate("%m/%d/%Y")
<SeriesHE>
<Index>
a          1517-01-01
b          1517-04-01
c          1517-06-30
<<U1>      <object>

SeriesHE: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Assignment | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib