- 博客(12)
- 问答 (4)
- 收藏
- 关注
原创 项目中配置多个Servlet,注意web.xml和自动生成的@WebServlet("/Servlet")之间的冲突
TestServletA com.wechat.TestServletA TestServletA /TestServletA <servlet><servlet-name>TestServletB</servlet-name><servlet-class>com.wechat.TestSer...
2019-04-01 16:29:39 1554
原创 jupyter中加载虚拟环境选择
首先进入相应的虚拟环境:activate tensorflow-gpu然后输入以下:python -m ipykernel install --user --name tensorflow-gpu --display-name “Python3(tf-gpu)”
2019-02-20 17:07:29 660
原创 余弦相似度计算
def cosine_similarity(vector1, vector2): dot_product = 0.0 normA = 0.0 normB = 0.0 for a, b in zip(vector1, vector2): dot_product += a * b normA += a ** 2 normB...
2018-11-13 21:55:16 280
原创 网络的构建关键代码,词与下一个词实现连接
edges=[]edge=[0]*2for text in cut_list: words=text.lower().split() if len(words)>1: for j in range(0,len(words)-1): edge[0]=neg_dict.get(words[j]) edge[1]=...
2018-11-13 21:05:33 143
原创 对每句话根据,。!分段
def cut_sentence(a): symbol = '/,/./!' cut_list=[] j=0 for i in range(len(a)): if a[i] in symbol: cut_list.append(a[j:i]) j=i+1;# print(cut_list) ...
2018-11-13 21:04:33 122
原创 pandas 将数组格式保存为csv(txt)
np_data = np.array(data_arr)##写入文件pd_data = pd.DataFrame(np_data,columns=['filename','gender'])print(pd_data)pd_data.to_csv('pd_data.csv')
2018-11-13 21:02:36 3409
原创 Python 读取文件夹下所有文件
# 遍历指定目录,显示目录下的所有文件名def eachFile(filepath): pathDir = os.listdir(filepath) file_list=[] for allDir in pathDir: child = os.path.join('%s%s' % (filepath, allDir)) file_list...
2018-11-07 17:17:15 506
转载 词典的保存与读取
#保存 dict_name = {1:{1:2,3:4},2:{3:4,4:5}} f = open('temp.txt','w') f.write(str(dict_name)) f.close() #读取 f = open('temp.txt','r') ...
2018-11-07 16:18:32 279
原创 'Series' object has no attribute 'sort'
data = pd.read_excel(dish_profit, index_col = u'菜品名')data = data[u'盈利'].copy()data.sort_values(ascending = False)将data.sort()改为data.sort_values()
2018-09-20 14:40:07 2798
原创 No module named 'sklearn.liner_model'问题
from sklearn.liner_model import LinearRegression #导入线性回归模型model = LinearRegression()print(model)报错:ModuleNotFoundError Traceback (most recent call last)<ipython-input-24...
2018-09-20 10:12:20 11102 5
转载 Git的使用(一)
ZhaoXishi@LAPTOP-IV341QJL MINGW64 /d/gitsave$ initbash: init: command not foundZhaoXishi@LAPTOP-IV341QJL MINGW64 /d/gitsave$ git initInitialized empty Git repository in D:/gitsave/.git/ZhaoXis...
2018-09-19 23:09:26 116
空空如也
netty做硬件服务器 给客户端设备未收到设备响应如何重新发送?
2019-05-09
netty服务器端,主送发送指令,如果对方客户端未收到,如何设置重新发送??
2019-04-27
Servlet配置中改变 <url-pattern> Tomcat报错
2019-03-17
TA创建的收藏夹 TA关注的收藏夹
TA关注的人