#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- ''' A table of `Will Burtin's historical data`_ regarding antibiotic efficacies. This module contains one pandas Dataframe: ``data``. .. rubric:: ``data`` :bokeh-dataframe:`bokeh.sampledata.antibiotics.data` .. _Will Burtin's historical data: https://medium.com/@harshdev_41068/burtins-legendary-data-on-antibiotics-9b32ecd5943f ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- from __future__ import annotations import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports from io import StringIO #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- __all__ = ( 'data', ) CSV = """ bacteria, penicillin, streptomycin, neomycin, gram Mycobacterium tuberculosis, 800, 5, 2, negative Salmonella schottmuelleri, 10, 0.8, 0.09, negative Proteus vulgaris, 3, 0.1, 0.1, negative Klebsiella pneumoniae, 850, 1.2, 1, negative Brucella abortus, 1, 2, 0.02, negative Pseudomonas aeruginosa, 850, 2, 0.4, negative Escherichia coli, 100, 0.4, 0.1, negative Salmonella (Eberthella) typhosa, 1, 0.4, 0.008, negative Aerobacter aerogenes, 870, 1, 1.6, negative Brucella antracis, 0.001, 0.01, 0.007, positive Streptococcus fecalis, 1, 1, 0.1, positive Staphylococcus aureus, 0.03, 0.03, 0.001, positive Staphylococcus albus, 0.007, 0.1, 0.001, positive Streptococcus hemolyticus, 0.001, 14, 10, positive Streptococcus viridans, 0.005, 10, 40, positive Diplococcus pneumoniae, 0.005, 11, 10, positive """ #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- def _read_data(): ''' ''' from ..util.dependencies import import_required pd = import_required('pandas', 'antibiotics sample data requires Pandas (http://pandas.pydata.org) to be installed') return pd.read_csv(StringIO(CSV), skiprows=1, skipinitialspace=True, engine='python') #----------------------------------------------------------------------------- # Code #----------------------------------------------------------------------------- data = _read_data()