#----------------------------------------------------------------------------- # Copyright (c) Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- ''' Demographic details of the passengers on board of the Titanic. License: `Public Domain`_ This module contains one pandas Dataframe: ``data``. .. rubric:: ``data`` :bokeh-dataframe:`bokeh.sampledata.titanic.data` .. bokeh-sampledata-xref:: titanic ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import annotations import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports from typing import TYPE_CHECKING # Bokeh imports from ..util.sampledata import external_csv if TYPE_CHECKING: import pandas as pd #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- __all__ = ( 'data', ) #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- def _read_data() -> pd.DataFrame: data = external_csv('titanic', 'titanic_all.csv') return data #----------------------------------------------------------------------------- # Code #----------------------------------------------------------------------------- data = _read_data()