- 博客(3)
- 收藏
- 关注
转载 ggplot2画图
ggplot2 画图 基本要素 - Data - Mapping - Geometric - Scale - Statistics - Coordinate - Layer - Facet - Theme 查看ggplot2 里的 geom_函数 ls("package:ggplot2" 散点图 geom_point() x+y p <- ggplot(data = st.kilda, mapping = aes(x = BuildingArea, y = Price/1000))
2020-09-02 23:51:58
935
转载 Python re 正则表达式
Python re 正则表达式 菜鸟教程:link import re x = 'A123fsai?13djsf' y = '?as3211mkleg+ewrwyi' pattern = re.compile('\w+',re.I) # re.match(pattern, string, flags=0) 只检查字符串起始位置 m1 = re.match(pattern, x) m2 = re.match(pattern, y) print("m1 = ", m1) print("m2 = ", m2)
2020-08-30 14:22:46
265
原创 COMP5318 Python Numpy 求余弦相似度 欧几里得距离
Python求余弦相似度 import numpy as np import math x = [3, 1, 2, 4] y = [1, 2, 1, 2] def dotProduct(v1, v2): v1 = np.mat(v1) v2 = np.mat(v2) z = v1 * v2.T return z cosine_sim = dotProduct(x, y)/math.sqrt(dotProduct(x, x) * dotProduct(y, y)) p
2020-08-29 20:07:15
913
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅