Home > other >  Python according to split column will form
Python according to split column will form

Time:10-15

I did, in accordance with the method of a net friend he succeeded to the file, but with my own file error
M=INVALID_TITLE_REGEX search (value)
TypeError: expected string or bytes - like object

Objective: will the taian database download large table according to the years split into small tables, and placed in the same workbook
# the first step: call pandas package
The import pandas as pd
Step # 2: read data
Size=pd. Read_excel (r 'C: \ Users \ \ Desktop \ \ the investment factor 15006 homework \ data \ the size \ size XLSX') # read data file
Year_list=list (size) [r]. 'year' drop_duplicates ()) # to get the data class, to weight and put into the list
Step # 3: according to the category points sheet to store data
Writer=pd. ExcelWriter (r 'C: \ Users \ \ Desktop \ \ the investment factor 15006 homework \ data \ the size \ size_sheets XLSX') # to create data storage path
For I in year_list:
Size1=size [size==[' year ']] I
Size1. To_excel (writer, I)
Writer. The save () # file
Writer. The close () # file closed

You cannot post I need to deal with file, bosses, please help me have a look, glad!
  • Related