
    fi                     ~    d Z ddlZddlZddlZddlmZ dej        fdZe	dk    r e            Z
 ee
           dS dS )u   
Date: 2024/7/22 17:30
Desc: 申万宏源研究-行业分类
http://www.swhyresearch.com/institute_sw/allIndex/downloadCenter/industryType
    Nheadersreturnc                  |   d} t          j        | t                    }t          j        t          j        |j                  ddd          }|                    dddd	d
d           t          j	        |d         d          j
        j        |d<   t          j	        |d	         d          j
        j        |d	<   |S )u   
    申万宏源研究-行业分类-全部行业分类
    https://www.swsresearch.com/swindex/pdf/SwClass2021/StockClassifyUse_stock.xls
    :return: 个股行业分类变动历史
    :rtype: pandas.DataFrame
    zNhttps://www.swsresearch.com/swindex/pdf/SwClass2021/StockClassifyUse_stock.xlsr   str)   股票代码   行业代码)dtypesymbol
start_dateindustry_codeupdate_time)r   u   计入日期r	   u   更新日期T)columnsinplacecoerce)errors)requestsgetr   pd
read_excelioBytesIOcontentrenameto_datetimedtdate)urlrtemp_dfs      J/usr/local/lib/python3.11/dist-packages/akshare/stock/stock_industry_sw.pystock_industry_clf_hist_swr"      s     [CS'***Am

19eU%S%S  G NN$(+)	
 
      Nh   L  ^x   M N    __main__)__doc__r   pandasr   r   akshare.utils.consr   	DataFramer"   __name__stock_industry_clf_hist_sw_dfprint r#   r!   <module>r-      s     
			      & & & & & &BL    < z$>$>$@$@!	E
'((((( r#   