"""
选择拥有专利的企业
"""
import xlwt
import numpy as np
import pandas as pd

path = 'D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/六年数据.xls'
data_info = pd.read_excel(path)['申请（专利权）人']
data_1 = np.array(data_info).tolist()
data_2 = [i.split(";") for i in data_1]

data_num = len(data_2)
data_index = [len(data_2[i]) for i in range(data_num)]
data_3 = [data_2[i] for i in range(data_num)]
# 将所有数据放入一个列表中

all_data= []
for i in range(data_num):
    all_data = all_data+data_3[i]
all_data_array = np.array(all_data)
all_unique = np.unique(all_data_array).tolist()
all_unique_len = len(all_unique)



# workbook = xlwt.Workbook(encoding = 'utf-8')
# xlsheet = workbook.add_sheet("专利归属方",cell_overwrite_ok=True)
# xlsheet.write(0, 0, '申请（专利权）人')
# workbook.save('F:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_1.xls')
#
#
#
workbook = xlwt.Workbook(encoding = 'utf-8')
xlsheet = workbook.add_sheet("专利归属方",cell_overwrite_ok=True)
xlsheet.write(0, 0, '申请（专利权）人')

for rows in range(all_unique_len):

    xlsheet.write(rows+1,0, all_unique[rows])
    xlsheet.write(rows+1,1,rows+1001)

workbook.save('D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_x.xls')

7bdbff9fcdd75a3288eeb52c6c052a62ab9378ab
<mask token>

<mask token>
for i in range(data_num):
    all_data = all_data + data_3[i]
<mask token>
xlsheet.write(0, 0, '申请（专利权）人')
for rows in range(all_unique_len):
    xlsheet.write(rows + 1, 0, all_unique[rows])
    xlsheet.write(rows + 1, 1, rows + 1001)
workbook.save('D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_x.xls')

<mask token>
path = 'D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/六年数据.xls'
data_info = pd.read_excel(path)['申请（专利权）人']
data_1 = np.array(data_info).tolist()
data_2 = [i.split(';') for i in data_1]
data_num = len(data_2)
data_index = [len(data_2[i]) for i in range(data_num)]
data_3 = [data_2[i] for i in range(data_num)]
all_data = []
for i in range(data_num):
    all_data = all_data + data_3[i]
all_data_array = np.array(all_data)
all_unique = np.unique(all_data_array).tolist()
all_unique_len = len(all_unique)
workbook = xlwt.Workbook(encoding='utf-8')
xlsheet = workbook.add_sheet('专利归属方', cell_overwrite_ok=True)
xlsheet.write(0, 0, '申请（专利权）人')
for rows in range(all_unique_len):
    xlsheet.write(rows + 1, 0, all_unique[rows])
    xlsheet.write(rows + 1, 1, rows + 1001)
workbook.save('D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_x.xls')

<mask token>
import xlwt
import numpy as np
import pandas as pd
path = 'D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/六年数据.xls'
data_info = pd.read_excel(path)['申请（专利权）人']
data_1 = np.array(data_info).tolist()
data_2 = [i.split(';') for i in data_1]
data_num = len(data_2)
data_index = [len(data_2[i]) for i in range(data_num)]
data_3 = [data_2[i] for i in range(data_num)]
all_data = []
for i in range(data_num):
    all_data = all_data + data_3[i]
all_data_array = np.array(all_data)
all_unique = np.unique(all_data_array).tolist()
all_unique_len = len(all_unique)
workbook = xlwt.Workbook(encoding='utf-8')
xlsheet = workbook.add_sheet('专利归属方', cell_overwrite_ok=True)
xlsheet.write(0, 0, '申请（专利权）人')
for rows in range(all_unique_len):
    xlsheet.write(rows + 1, 0, all_unique[rows])
    xlsheet.write(rows + 1, 1, rows + 1001)
workbook.save('D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_x.xls')

"""
选择拥有专利的企业
"""
import xlwt
import numpy as np
import pandas as pd

path = 'D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/六年数据.xls'
data_info = pd.read_excel(path)['申请（专利权）人']
data_1 = np.array(data_info).tolist()
data_2 = [i.split(";") for i in data_1]

data_num = len(data_2)
data_index = [len(data_2[i]) for i in range(data_num)]
data_3 = [data_2[i] for i in range(data_num)]
# 将所有数据放入一个列表中

all_data= []
for i in range(data_num):
    all_data = all_data+data_3[i]
all_data_array = np.array(all_data)
all_unique = np.unique(all_data_array).tolist()
all_unique_len = len(all_unique)



# workbook = xlwt.Workbook(encoding = 'utf-8')
# xlsheet = workbook.add_sheet("专利归属方",cell_overwrite_ok=True)
# xlsheet.write(0, 0, '申请（专利权）人')
# workbook.save('F:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_1.xls')
#
#
#
workbook = xlwt.Workbook(encoding = 'utf-8')
xlsheet = workbook.add_sheet("专利归属方",cell_overwrite_ok=True)
xlsheet.write(0, 0, '申请（专利权）人')

for rows in range(all_unique_len):

    xlsheet.write(rows+1,0, all_unique[rows])
    xlsheet.write(rows+1,1,rows+1001)

workbook.save('D:/挖掘/实验一：数据及数据预处理/电子信息产业原始数据/7电子计算机数据处理及应用/专利人_x.xls')
