
    fiy                     j    d Z ddlZddlZdej        fdZedk    r e            Z ee           dS dS )uQ   
Date: 2024/3/21 11:16
Desc: 行情宝
https://hqb.nxin.com/pigindex/index.shtml
    Nreturnc                     d} ddi}t          j        | |          }|                                }t          j        |d                   }g d|_        t          j        |d         d	          t          j        d
          z   j        j	        |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   |S )u   
    行情宝-生猪市场价格指数
    https://hqb.nxin.com/pigindex/index.shtml
    :return: 生猪市场价格指数
    :rtype: pandas.DataFrame
    z4https://hqb.nxin.com/pigindex/getPigIndexChart.shtmlregionId0)paramsdata)   日期   指数   4个月均线   6个月均线   12个月均线   预售均价   成交均价   成交均重r	   ms)unit   )hoursr
   coerce)errorsr   r   r   r   r   r   )requestsgetjsonpd	DataFramecolumnsto_datetime	Timedeltadtdate
to_numeric)urlr   r	data_jsontemp_dfs        B/usr/local/lib/python3.11/dist-packages/akshare/index/index_hog.pyindex_hog_spot_pricer'      sr    AC#FS(((AIl9V,--G	 	 	GO 	wx(t444r|!7L7L7LL H gh&7IIIGH!}W_-EhWWWGO!}W_-EhWWWGO "g6F.GPX Y Y YG mGN,CHUUUGN mGN,CHUUUGN mGN,CHUUUGNN    __main__)	__doc__pandasr   r   r   r'   __name__index_hog_spot_price_dfprint r(   r&   <module>r0      s          bl        F z2244	E
!""""" r(   