The given code is performing the following operations:

  1. Dropping the columns 'Sub Industry', 'Company Name', 'Number of Punished', 'Financial Penalty' from the dataframe 'data'.
  2. Converting the 'Date' column to datetime format using the pd.to_datetime() function.
  3. Extracting the year from the 'Date' column and creating a new column 'year' in the dataframe.
  4. Extracting the month from the 'Date' column and creating a new column 'mon' in the dataframe.
  5. Extracting the day of the week from the 'Date' column and creating a new column 'dayofweek' in the dataframe

原文地址: http://www.cveoy.top/t/topic/hCXr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录