apriori算法所用资料的思维导图apriori算法所用资料
从excel加载数据
import requests
from lxml import etree
import math
import time
import datetime
import pandas as pd
import json
import csv
import codecs#codecs.BOM_UTF8
import re
import locale
import json
import multiprocessing
from mlxtend.preprocessing import TransactionEncoder
from mlxtend.frequent_patterns import apriori
zcd=pd.read_excel("E://药食//鼻炎中药处方.xlsx")
zcd.columns=['药品名称', '处方来源', '页码', '处方']
函数redata去除无关字符
def redata(string):
pattern=re.compile("等[\u4e00-\u9fa5]*")
string1=re.sub(pattern,'',string)
#string1=string1.replace('本品为','').replace('浸膏粉','').replace('挥发油','').replace('制成的','&#