Ë
    {�hý3  ã                   ó¤   — d Z ddlZddlmZ ddlmc mZ h d£Zh d£Z		 	 	 	 	 dd„Z
dd„Zdd„Zdd	„Zdd
„Zd„ Zdd„Zdd„Zdd„Zdd„Zdd„Zd„ Zy)zE
Built-in datasets for demonstration, educational and test purposes.
é    N)Úimport_module>   ÚcudfÚmodinÚpandasÚpolarsÚpyarrow>   r   r   r   c                 ó>  — t        j                  t        d|¬«      d¬«      }|r'|j                  t        j                  d«      |k(  «      }| r‡|j                  t        j                  t        j                  d«      j                  t        j                  «       «      t        j                  d«      g«      j                  j                  d¬«      «      }|s|j                  d	d
«      }|r$|j                  t        dddddddddd¬«
      «      }|j                  «       S )a  
    Each row represents a country on a given year.

    https://www.gapminder.org/data/

    Parameters
    ----------
    datetimes: bool
        Whether or not 'year' column will converted to datetime type

    centroids: bool
        If True, ['centroid_lat', 'centroid_lon'] columns are added

    year: int | None
        If provided, the dataset will be filtered for that year

    pretty_names: bool
        If True, prettifies the column names

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 1704 rows and the following columns:
        `['country', 'continent', 'year', 'lifeExp', 'pop', 'gdpPercap',
        'iso_alpha', 'iso_num']`.

        If `datetimes` is True, the 'year' column will be a datetime column
        If `centroids` is True, two new columns are added: ['centroid_lat', 'centroid_lon']
        If `year` is an integer, the dataset will be filtered for that year
    Ú	gapminder©Úreturn_typeT©Ú
eager_onlyÚyearz-01-01z%Y-%m-%d)ÚformatÚcentroid_latÚcentroid_lonÚCountryÚ	ContinentÚYearzLife ExpectancyzGDP per CapitaÚ
PopulationzISO Alpha Country CodezISO Numeric Country CodezCentroid LatitudezCentroid Longitude)
ÚcountryÚ	continentr   ÚlifeExpÚ	gdpPercapÚpopÚ	iso_alphaÚiso_numr   r   )ÚnwÚfrom_nativeÚ_get_datasetÚfilterÚcolÚwith_columnsÚ
concat_strÚcastÚStringÚlitÚstrÚto_datetimeÚdropÚrenameÚdictÚ	to_native)Ú	datetimesÚ	centroidsr   Úpretty_namesr   Údfs         úR/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/plotly/data/__init__.pyr
   r
      sò   € ôP 
�‰Ü�[¨kÔ:Àtô
€Bñ Ø�Y‰Y”r—v‘v˜f“~¨Ñ-Ó.ˆÙØ�_‰_ô �M‰MÜ—‘˜“×$Ñ$¤R§Y¡Y£[Ó1´2·6±6¸(Ó3CÐDóç‰c—+‘+ Z�+Ó0ó
ˆñ Ø�W‰W�^ ^Ó4ˆÙØ�Y‰YÜØ!Ø%ØØ)Ø*Ø Ø2Ø2Ø0Ø1ôó
ˆð �<‰<‹>Ðó    c                 ó¬   — t        j                  t        d|¬«      d¬«      }| r!|j                  t	        ddddd	d
d¬«      «      }|j                  «       S )a
  
    Each row represents a restaurant bill.

    https://vincentarelbundock.github.io/Rdatasets/doc/reshape2/tips.html

    Parameters
    ----------
    pretty_names: bool
        If True, prettifies the column names

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 244 rows and the following columns:
        `['total_bill', 'tip', 'sex', 'smoker', 'day', 'time', 'size']`.
    Útipsr   Tr   z
Total BillÚTipzPayer GenderzSmokers at TablezDay of WeekÚMealz
Party Size)Ú
total_billÚtipÚsexÚsmokerÚdayÚtimeÚsize)r   r   r    r+   r,   r-   )r0   r   r1   s      r2   r5   r5   V   sX   € ô* 
�‰œ V¸ÔEÐRVÔ	W€BÙØ�Y‰YÜØ'ØØ"Ø)Ø!ØØ!ôó

ˆð �<‰<‹>Ðr3   c                 ó   — t        d| ¬«      S )aÃ  
    Each row represents a flower.

    https://en.wikipedia.org/wiki/Iris_flower_data_set

    Parameters
    ----------
    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 150 rows and the following columns:
        `['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species', 'species_id']`.
    Úirisr   ©r    r   s    r2   r@   r@   {   s   € ô" ˜¨KÔ8Ð8r3   c                 ó   — t        d| ¬«      S )a–  
    Each row represents a level of wind intensity in a cardinal direction, and its frequency.

    Parameters
    ----------
    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 128 rows and the following columns:
        `['direction', 'strength', 'frequency']`.
    Úwindr   rA   r   s    r2   rC   rC   �   s   € ô ˜¨KÔ8Ð8r3   c                 ó   — t        d| ¬«      S )aÔ  
    Each row represents voting results for an electoral district in the 2013 Montreal
    mayoral election.

    Parameters
    ----------
    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 58 rows and the following columns:
        `['district', 'Coderre', 'Bergeron', 'Joly', 'total', 'winner', 'result', 'district_id']`.
    Úelectionr   rA   r   s    r2   rE   rE   ¡   ó   € ô  ˜
°Ô<Ð<r3   c                  ór  — ddl } ddl}ddl}|j                  j	                  |j                  j                  |j                  j                  t        «      «      ddd«      }| j                  |d«      5 }|j                  |j                  «       j                  d«      «      }ddd«       |S # 1 sw Y   S xY w)a@  
    Each feature represents an electoral district in the 2013 Montreal mayoral election.

    Returns
    -------
        A GeoJSON-formatted `dict` with 58 polygon or multi-polygon features whose `id`
        is an electoral district numerical ID and whose `district` property is the ID and
        district name.
    r   NÚpackage_dataÚdatasetszelection.geojson.gzÚrzutf-8)ÚgzipÚjsonÚosÚpathÚjoinÚdirnameÚ__file__ÚGzipFileÚloadsÚreadÚdecode)rK   rL   rM   rN   ÚfÚresults         r2   Úelection_geojsonrX   ´   sŽ   € ó ÛÛà�7‰7�<‰<Ø
�‰�‰˜Ÿ™Ÿ™¬Ó1Ó2ØØØó	€Dð 
�‰�t˜SÓ	!ð 6 QØ—‘˜AŸF™F›HŸO™O¨GÓ4Ó5ˆ÷6à€M÷6à€Mús   Á3/B,Â,B6c                 ó   — t        d| ¬«      S )aÔ  
    Each row represents the availability of car-sharing services near the centroid of a zone
    in Montreal over a month-long period.

    Parameters
    ----------
    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe` with 249 rows and the following columns:
        `['centroid_lat', 'centroid_lon', 'car_hours', 'peak_hour']`.
    Úcarsharer   rA   r   s    r2   rZ   rZ   Í   rF   r3   c                 ó  — | r|t         vrd|› d�}t        |«      ‚t        j                  t	        d|¬«      d¬«      j                  t        j                  d«      j                  t        j                  «       «      «      }|r<|j                  t        j                  d«      j                  j                  «       «      }| r2|j                  «       j                  d«      }d|j                  _        |S |j                  «       S )	ai  
    Each row in this wide dataset represents closing prices from 6 tech stocks in 2018/2019.

    Parameters
    ----------
    indexed: bool
        Whether or not the 'date' column is used as the index and the column index
        is named 'company'. Applicable only if `return_type='pandas'`

    datetimes: bool
        Whether or not the 'date' column will be of datetime type

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 100 rows and the following columns:
        `['date', 'GOOG', 'AAPL', 'AMZN', 'FB', 'NFLX', 'MSFT']`.
        If `indexed` is True, the 'date' column is used as the index and the column index
        is named 'company'
        If `datetimes` is True, the 'date' column will be a datetime column
    ú	Backend 'ú ' does not support setting indexÚstocksr   Tr   ÚdateÚcompany)ÚBACKENDS_WITH_INDEX_SUPPORTÚNotImplementedErrorr   r   r    r#   r"   r%   r&   r(   r)   r-   Ú	set_indexÚcolumnsÚname)Úindexedr.   r   Úmsgr1   s        r2   r^   r^   à   sÈ   € ñ2 �;Ô&AÑAØ˜+˜Ð&FÐGˆÜ! #Ó&Ð&ä	�‰Ü�X¨;Ô7ÀDô
ç�l”2—6‘6˜&“>×&Ñ&¤r§y¡y£{Ó3Ó4ð ñ Ø�_‰_œRŸV™V F›^×/Ñ/×;Ñ;Ó=Ó>ˆáØ�\‰\‹^×%Ñ% fÓ-ˆØ#ˆ�
‰
ŒØˆ	à�<‰<‹>Ðr3   c                 óæ   — | r|t         vrd|› d�}t        |«      ‚t        j                  t	        d|¬«      d¬«      }| r#|j                  «       }d|j                  _        |S |j                  «       S )aÏ  
    Each row in this wide dataset represents the results of 100 simulated participants
    on three hypothetical experiments, along with their gender and control/treatment group.

    Parameters
    ----------
    indexed: bool
        If True, then the index is named "participant".
        Applicable only if `return_type='pandas'`

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 100 rows and the following columns:
        `['experiment_1', 'experiment_2', 'experiment_3', 'gender', 'group']`.
        If `indexed` is True, the data frame index is named "participant"
    r\   r]   Ú
experimentr   Tr   Úparticipant)ra   rb   r   r   r    r-   Úindexre   ©rf   r   rg   r1   s       r2   ri   ri     so   € ñ, �;Ô&AÑAØ˜+˜Ð&FÐGˆÜ! #Ó&Ð&ä	�‰Ü�\¨{Ô;Èô
€Bñ Ø�\‰\‹^ˆØ%ˆ�‰ŒØˆ	Ø�<‰<‹>Ðr3   c                 ó  — | r|t         vrd|› d�}t        |«      ‚t        j                  t	        d|¬«      d¬«      }| r2|j                  «       j                  d«      }d|j                  _        |S |j                  «       S )	aÓ  
    This dataset represents the medal table for Olympic Short Track Speed Skating for the
    top three nations as of 2020.

    Parameters
    ----------
    indexed: bool
        Whether or not the 'nation' column is used as the index and the column index
        is named 'medal'. Applicable only if `return_type='pandas'`

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 3 rows and the following columns:
        `['nation', 'gold', 'silver', 'bronze']`.
        If `indexed` is True, the 'nation' column is used as the index and the column index
        is named 'medal'
    r\   r]   Úmedalsr   Tr   ÚnationÚmedal)	ra   rb   r   r   r    r-   rc   rd   re   rl   s       r2   Úmedals_widerq   0  sz   € ñ. �;Ô&AÑAØ˜+˜Ð&FÐGˆÜ! #Ó&Ð&ä	�‰Ü�X¨;Ô7ÀDô
€Bñ Ø�\‰\‹^×%Ñ% hÓ/ˆØ!ˆ�
‰
ŒØˆ	Ø�<‰<‹>Ðr3   c                 óò   — | r|t         vrd|› d�}t        |«      ‚t        j                  t	        d|¬«      d¬«      j                  dgdd	¬
«      }| rt        j                  |d«      }|j                  «       S )an  
    This dataset represents the medal table for Olympic Short Track Speed Skating for the
    top three nations as of 2020.

    Parameters
    ----------
    indexed: bool
        Whether or not the 'nation' column is used as the index.
        Applicable only if `return_type='pandas'`

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
        Dataframe with 9 rows and the following columns: `['nation', 'medal', 'count']`.
        If `indexed` is True, the 'nation' column is used as the index.
    r\   r]   rn   r   Tr   ro   Úcountrp   )rk   Ú
value_nameÚvariable_name)ra   rb   r   r   r    ÚunpivotÚmaybe_set_indexr-   rl   s       r2   Úmedals_longrx   U  sƒ   € ñ* �;Ô&AÑAØ˜+˜Ð&FÐGˆÜ! #Ó&Ð&ä	�‰Ü�X¨;Ô7ÀDô
ç�gØˆjØØð ó ð ñ Ü×Ñ  HÓ-ˆØ�<‰<‹>Ðr3   c                 ó"  — t         j                  j                  t         j                  j                  t         j                  j                  t        «      «      dd| dz   «      }|t
        vrd|› dt
        › �}t        |«      ‚	 |dk(  rd}n
|dk(  rd	}n|}t        |«      }	 |j                  |«      S # t        $ r d
|› d|› d�}t        |«      ‚w xY w# t        $ r1}d| › d|› �}t        |«      j                  |j                  «      ‚d}~ww xY w)aI  
    Loads the dataset using the specified backend.

    Notice that the available backends are 'pandas', 'polars', 'pyarrow' and they all have
    a `read_csv` function (pyarrow has it via pyarrow.csv). Therefore we can dynamically
    load the library using `importlib.import_module` and then call
    `backend.read_csv(filepath)`.

    Parameters
    ----------
    d: str
        Name of the dataset to load.

    return_type: {'pandas', 'polars', 'pyarrow', 'modin', 'cudf'}
        Type of the resulting dataframe

    Returns
    -------
    Dataframe of `return_type` type
    rH   rI   z.csv.gzzUnsupported return_type. Found z, expected one of r   zpyarrow.csvr   zmodin.pandaszreturn_type=z, but z is not installedzUnable to read 'z' dataset due to: N)rM   rN   rO   rP   rQ   ÚAVAILABLE_BACKENDSrb   r   ÚModuleNotFoundErrorÚread_csvÚ	ExceptionÚwith_tracebackÚ__traceback__)Údr   Úfilepathrg   Úmodule_to_loadÚbackendÚes          r2   r    r    z  s&  € ô* �w‰w�|‰|Ü
�‰�‰œŸ™Ÿ™¬Ó1Ó2ØØØ	ˆI‰ó	€Hð Ô,Ñ,à-¨k¨]ð ;Ü$Ð%ð'ð 	ô " #Ó&Ð&ð
'Ø˜)Ò#Ø*‰NØ˜GÒ#Ø+‰Nà(ˆNÜ Ó/ˆð
=Ø×Ñ Ó)Ð)øô ò 'Ø˜[˜M¨°¨}Ð<MÐNˆÜ! #Ó&Ð&ð'ûô ò =Ø   Ð#5°a°SÐ9ˆÜ˜‹n×+Ñ+¨A¯O©OÓ<Ð<ûð=ús$   ÂB3 Â"C Â3CÃ	DÃ,D	Ä	D)FFNFr   )Fr   )r   )FFr   )Ú__doc__rM   Ú	importlibr   Únarwhals.stable.v1ÚstableÚv1r   rz   ra   r
   r5   r@   rC   rE   rX   rZ   r^   ri   rq   rx   r    © r3   r2   ú<module>r‹      sx   ðñó 
Ý #ç Ð âEÐ Ú9Ð ð ØØ	ØØóFóR"óJ9ó(9ó$=ò&ó2=ó&)óX!óH"óJ"óJ3=r3   