5.2. Series Create

5.2.1. SetUp

>>> import pandas as pd
>>> import numpy as np

5.2.2. From Ordered Sequences

  • list

  • tuple

>>> data = ['Alice', 'Bob', 'Carol']
>>> result = pd.Series(data)
>>>
>>> result
0    Alice
1      Bob
2    Carol
dtype: str
>>> data = ('Alice', 'Bob', 'Carol')
>>> result = pd.Series(data)
>>>
>>> result
0    Alice
1      Bob
2    Carol
dtype: str

5.2.3. From Unordered Sequences

  • set

  • frozenset

  • Not possible

>>> data = {'Alice', 'Bob', 'Carol'}
>>> result = pd.Series(data)
Traceback (most recent call last):
TypeError: 'set' type is unordered
>>> data = frozenset({'Alice', 'Bob', 'Carol'})
>>> result = pd.Series(data)
Traceback (most recent call last):
TypeError: 'frozenset' type is unordered

5.2.4. From Python range

  • range(start, stop, step)

>>> data = range(0, 5)
>>> result = pd.Series(data)
>>>
>>> result
0    0
1    1
2    2
3    3
4    4
dtype: int64

5.2.5. From Numpy ndarray

  • np.arange(start, stop, step)

>>> data = np.arange(0.0, 4.0)
>>> result = pd.Series(data)
>>>
>>> result
0    0.0
1    1.0
2    2.0
3    3.0
dtype: float64

5.2.6. From List of Timestamps

  • pd.Timestamp(year, month, day)

  • pd.Timestamp(str)

  • pd.Timestamp(str, tz=timezone)

  • More information in Date and Time Types

Timezone naive:

>>> data = [
...     pd.Timestamp('2000-01-01'),
...     pd.Timestamp('2000-01-02'),
...     pd.Timestamp('2000-01-03'),
...     pd.Timestamp('2000-01-04'),
...     pd.Timestamp('2000-01-05'),
... ]
>>>
>>> result = pd.Series(data)
>>>
>>> result
0   2000-01-01
1   2000-01-02
2   2000-01-03
3   2000-01-04
4   2000-01-05
dtype: datetime64[us]

Timezone aware:

>>> data = [
...     pd.Timestamp('2000-01-01', tz='UTC'),
...     pd.Timestamp('2000-01-02', tz='UTC'),
...     pd.Timestamp('2000-01-03', tz='UTC'),
...     pd.Timestamp('2000-01-04', tz='UTC'),
...     pd.Timestamp('2000-01-05', tz='UTC'),
... ]
>>>
>>> result = pd.Series(data)
>>>
>>> result
0   2000-01-01 00:00:00+00:00
1   2000-01-02 00:00:00+00:00
2   2000-01-03 00:00:00+00:00
3   2000-01-04 00:00:00+00:00
4   2000-01-05 00:00:00+00:00
dtype: datetime64[us, UTC]

5.2.7. From Date Range

  • pd.date_range(start, end, freq)

  • pd.date_range(start, freq, periods)

  • More information in Date and Time Types

>>> data = pd.date_range(start='2000-01-01', end='2000-01-05', freq='D')
>>> result = pd.Series(data)
>>>
>>> result
0   2000-01-01
1   2000-01-02
2   2000-01-03
3   2000-01-04
4   2000-01-05
dtype: datetime64[us]
>>> data = pd.date_range(start='2000-01-01', freq='D', periods=5)
>>> result = pd.Series(data)
>>>
>>> result
0   2000-01-01
1   2000-01-02
2   2000-01-03
3   2000-01-04
4   2000-01-05
dtype: datetime64[us]

5.2.8. Assignments

# %% About
# - Name: Series Create Int
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0    1
# 1    2
# 2    3
# 3    4
# 4    5
# dtype: int64

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 5, \
'Variable `result` has an invalid length; expected: `5`.'

>>> assert result.dtype.name == 'int64', \
'Series `result` has an invalid dtype; expected: `int64`.'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0    1
1    2
2    3
3    4
4    5
dtype: int64
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = [1, 2, 3, 4, 5]

# %% Result
result = ...

# %% About
# - Name: Series Create Float
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0    1.1
# 1    2.2
# 2    3.3
# 3    4.4
# 4    5.5
# 5    NaN
# dtype: float64

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 6, \
'Variable `result` has an invalid length; expected: `6`.'

>>> assert result.dtype.name == 'float64', \
'Series `result` has an invalid dtype; expected: `float64`.'

>>> assert result.isnull().any(), \
'Series `result` has an invalid value; at least one value must be `None`'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0    1.1
1    2.2
2    3.3
3    4.4
4    5.5
5    NaN
dtype: float64
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = [1.1, 2.2, 3.3, 4.4, 5.5, None]

# %% Result
result = ...

# %% About
# - Name: Series Create Bool
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0     True
# 1    False
# 2     None
# dtype: object

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 3, \
'Variable `result` has an invalid length; expected: `3`.'

>>> assert result.dtype.name == 'object', \
'Series `result` has an invalid dtype; expected: `object`.'

>>> assert result.isnull().any(), \
'Series `result` has an invalid value; at least one value must be `None`'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0     True
1    False
2     None
dtype: object
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = [True, False, None]

# %% Result
result = ...

# %% About
# - Name: Series Create Str
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0    Alice
# 1      Bob
# 2    Carol
# 3     Dave
# 4      Eve
# 5      NaN
# dtype: str

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 6, \
'Variable `result` has an invalid length; expected: `6`.'

>>> assert result.dtype == 'str', \
'Series `result` has an invalid dtype; expected: `str`.'

>>> assert result.isnull().any(), \
'Series `result` has an invalid value; at least one value must be `None`'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0    Alice
1      Bob
2    Carol
3     Dave
4      Eve
5      NaN
dtype: str
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = ['Alice', 'Bob', 'Carol', 'Dave', 'Eve', None]

# %% Result
result = ...

# %% About
# - Name: Series Create Date
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0   2001-01-01
# 1   2002-02-02
# 2   2003-03-03
# 3   2004-04-04
# 4   2005-05-05
# dtype: datetime64[us]

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 5, \
'Variable `result` has an invalid length; expected: `5`.'

>>> assert result.dtype.name == 'datetime64[us]', \
'Series `result` has an invalid dtype; expected: `datetime64[us]`.'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0   2001-01-01
1   2002-02-02
2   2003-03-03
3   2004-04-04
4   2005-05-05
dtype: datetime64[us]
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = [
    pd.Timestamp('2001-01-01'),
    pd.Timestamp('2002-02-02'),
    pd.Timestamp('2003-03-03'),
    pd.Timestamp('2004-04-04'),
    pd.Timestamp('2005-05-05'),
]

# %% Result
result = ...

# %% About
# - Name: Series Create Datetime
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0   2001-01-01 01:01:01
# 1   2002-02-02 02:02:02
# 2   2003-03-03 03:03:03
# 3   2004-04-04 04:04:04
# 4   2005-05-05 05:05:05
# dtype: datetime64[us]

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 5, \
'Variable `result` has an invalid length; expected: `5`.'

>>> assert result.dtype.name == 'datetime64[us]', \
'Series `result` has an invalid dtype; expected: `datetime64[us]`.'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0   2001-01-01 01:01:01
1   2002-02-02 02:02:02
2   2003-03-03 03:03:03
3   2004-04-04 04:04:04
4   2005-05-05 05:05:05
dtype: datetime64[us]
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = [
    pd.Timestamp('2001-01-01 01:01:01'),
    pd.Timestamp('2002-02-02 02:02:02'),
    pd.Timestamp('2003-03-03 03:03:03'),
    pd.Timestamp('2004-04-04 04:04:04'),
    pd.Timestamp('2005-05-05 05:05:05'),
]

# %% Result
result = ...

# %% About
# - Name: Series Create Timezone
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0    2001-01-01 01:01:01+00:00
# 1    2002-02-02 02:02:02+00:00
# 2    2003-03-03 03:03:03+01:00
# 3    2004-04-04 04:04:04+02:00
# 4    2005-05-05 05:05:05+01:00
# dtype: object

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 5, \
'Variable `result` has an invalid length; expected: `5`.'

>>> assert result.dtype.name == 'object', \
'Series `result` has an invalid dtype; expected: `object`.'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0    2001-01-01 01:01:01+00:00
1    2002-02-02 02:02:02+00:00
2    2003-03-03 03:03:03+01:00
3    2004-04-04 04:04:04+02:00
4    2005-05-05 05:05:05+01:00
dtype: object
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = [
    pd.Timestamp('2001-01-01 01:01:01', tz='UTC'),
    pd.Timestamp('2002-02-02 02:02:02', tz='GMT'),
    pd.Timestamp('2003-03-03 03:03:03', tz='Europe/Warsaw'),
    pd.Timestamp('2004-04-04 04:04:04', tz='Poland'),
    pd.Timestamp('2005-05-05 05:05:05', tz='Etc/GMT-1'),
]

# %% Result
result = ...

# %% About
# - Name: Series Create DateRange
# - Difficulty: easy
# - Lines: 1
# - Minutes: 1

# %% License
# - Copyright 2025, Matt Harasymczuk <matt@python3.info>
# - This code can be used only for learning by humans
# - This code cannot be used for teaching others
# - This code cannot be used for teaching LLMs and AI algorithms
# - This code cannot be used in commercial or proprietary products
# - This code cannot be distributed in any form
# - This code cannot be changed in any form outside of training course
# - This code cannot have its license changed
# - If you use this code in your product, you must open-source it under GPLv2
# - Exception can be granted only by the author

# %% English
# 1. Use `DATA` to create `pd.Series`
# 2. Define variable `result` with the solution
# 3. Run doctests - all must succeed

# %% Polish
# 1. Użyj `DATA`, aby stworzyć `pd.Series`
# 2. Zdefiniuj zmienną `result` z rozwiązaniem
# 3. Uruchom doctesty - wszystkie muszą się powieść

# %% Expected
# >>> result
# 0   2000-01-01
# 1   2000-01-02
# 2   2000-01-03
# 3   2000-01-04
# 4   2000-01-05
# dtype: datetime64[us]

# %% Doctests
"""
>>> import sys; sys.tracebacklimit = 0

>>> assert sys.version_info >= (3, 9), \
'Python has an is invalid version; expected: `3.9` or newer.'

>>> assert 'result' in globals(), \
'Variable `result` is not defined; assign result of your program to it.'

>>> assert result is not Ellipsis, \
'Variable `result` has an invalid value; assign result of your program to it.'

>>> assert type(result) is pd.Series, \
'Variable `result` has an invalid type; expected: `pd.Series`.'

>>> assert len(result) == 5, \
'Variable `result` has an invalid length; expected: `5`.'

>>> assert result.dtype.name == 'datetime64[us]', \
'Series `result` has an invalid dtype; expected: `datetime64[us]`.'

>>> pd.set_option('display.max_columns', 50)
>>> pd.set_option('display.max_rows', 200)
>>> pd.set_option('display.width', 500)
>>> pd.set_option('display.memory_usage', 'deep')
>>> pd.set_option('display.precision', 4)

>>> result
0   2000-01-01
1   2000-01-02
2   2000-01-03
3   2000-01-04
4   2000-01-05
dtype: datetime64[us]
"""

# %% Run
# - PyCharm: right-click in the editor and `Run Doctest in ...`
# - PyCharm: keyboard shortcut `Control + Shift + F10`
# - Terminal: `python -m doctest -f -v myfile.py`

# %% Imports
import pandas as pd

# %% Types
result: pd.Series

# %% Data
DATA = pd.date_range(start='2000-01-01', periods=5, freq='D')

# %% Result
result = ...