a
    J¸DfÑ  ã                   @  sp   d Z ddlmZ ddlZe e¡ZddlmZ ddl	m
Z
 erFddlZdZddd	œd
d„Ze
ddƒZeeƒZdS )aÛ   A version of the Auto MPG data set.

License: `CC0`_

Sourced from https://archive.ics.uci.edu/ml/datasets/auto+mpg

This module contains two pandas Dataframes: ``autompg`` and ``autompg_clean``.
The "clean" version has cleaned up the ``"mfr"`` and ``"origin"`` fields.

.. rubric:: ``autompg``

:bokeh-dataframe:`bokeh.sampledata.autompg.autompg`

.. rubric:: ``autompg_clean``

:bokeh-dataframe:`bokeh.sampledata.autompg.autompg_clean`

.. bokeh-sampledata-xref:: autompg
é    )ÚannotationsN)ÚTYPE_CHECKINGé   )Úpackage_csv)ÚautompgÚautompg_cleanzpd.DataFrame)ÚdfÚreturnc                   sÊ   |   ¡ } dd„ | jD ƒ| d< d| j| jdkdf< d| j| jdkdf< d| j| jdkdf< d	| j| jd
kdf< d| j| jdkdf< d| j| jdkdf< d| j| jdkdf< g d¢‰ ‡ fdd„| jD ƒ| _| S )z

    c                 S  s   g | ]}|  ¡ d  ‘qS )r   )Úsplit©Ú.0Úx© r   úe/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/bokeh/sampledata/autompg.pyÚ
<listcomp>K   ó    z_clean_data.<locals>.<listcomp>ÚmfrZ	chevroletZchevyZ	chevroeltZmazdaZmaxdaZmercedeszmercedes-benzZtoyotaZtoyoutaZ
volkswagenZ	vokswagenZvw)zNorth AmericaZEuropeZAsiac                   s   g | ]}ˆ |d   ‘qS )é   r   r   ©ZORIGINSr   r   r   U   r   )ÚcopyÚnameÚlocr   Úorigin)r   r   r   r   Ú_clean_dataF   s    r   r   zauto-mpg.csv)Ú__doc__Ú
__future__r   ÚloggingÚ	getLoggerÚ__name__ÚlogÚtypingr   Zutil.sampledatar   ZpandasÚpdÚ__all__r   r   r   r   r   r   r   Ú<module>   s   

