![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
机器学习
文章平均质量分 88
zhangbigxu
The best is yet to come
展开
-
Neo4j构建路网
一:获取HTML从 www.openstreetmap.org查询需要导出的经纬度范围SELECT MIN(haikou_1.starting_lat),MAX(starting_lat),MIN(starting_lng),MAX(starting_lng)from haikou_1 19.5271 20.1525 110.1313 110.6985...原创 2020-04-13 13:43:40 · 421 阅读 · 0 评论 -
根据Geohash编码画中心点和边框
#得到司机的Geohash后返回前六位Geohash的图像from pygeohash import encode, decodeimport plotlyimport plotly.plotly as pyfimport plotly.graph_objs as goimport numpy as npimport pandas as pdimport mathfrom mat...原创 2020-01-18 14:13:08 · 1336 阅读 · 0 评论 -
测试_根据位置经纬度返回最近的Geohash
# 现在要做:# 2:取Geohash的前N位# 3:计算前位Geohash的demand#4 返回离司机最近的最有可能接单的Geohash位置和demandfrom pygeohash import encode, decodeimport plotlyimport plotly.plotly as pyfimport plotly.graph_objs as goimport...原创 2020-01-17 15:51:45 · 368 阅读 · 0 评论 -
Python常用技巧
1把str转为list列表taxi_geo1=taxi_geo1.split(",") #把str转为list列表原创 2020-01-17 13:13:14 · 154 阅读 · 0 评论 -
控制台输入Geohash的位数得到对应Geohash的订单量和占比
MySQL语句包含嵌套查询# 现在要做:# 2:取Geohash的前N位# 3:计算前位Geohash的demand# 4:根据出租车的位置经纬度返回最近的Geohashfrom pygeohash import encode, decodeimport plotlyimport plotly.plotly as pyfimport plotly.graph_objs as go...原创 2020-01-17 10:51:17 · 254 阅读 · 0 评论 -
取Geohash的前N位
def top_geohash(geohash1,n): new_total = [] # 根据total 得到的前4位全部的编码 block_dict = {} central_dict = {} for i in geohash1: new_total.append(i[:n]) # 取前n个geohash return new_to...原创 2020-01-17 08:51:50 · 310 阅读 · 0 评论 -
MySQL里的经纬度转为Geohash后插回数据库
MySQL里的经纬度转为Geohash后插回数据库from pygeohash import encode, decodeimport plotlyimport plotly.plotly as pyfimport plotly.graph_objs as goimport numpy as npimport pandas as pdimport mathfrom matplotl...原创 2020-01-16 21:30:30 · 1058 阅读 · 0 评论 -
MySQL分组后统计
MySQL分组后统计select count(*) as number ,BeginLongitude , BeginLatitude FROM Order_Data where FROM_UNIXTIME(BeginTime) <'2016-11-01 00:05:00' GROUP BY BeginLongitude, BeginLatitude原创 2020-01-16 17:52:27 · 1199 阅读 · 0 评论 -
把经纬度转换为Geohash(准确)
# 现在要做:# 1:把数据库的经纬度读出生成Geohash# 2:取Geohash的前N位# 3:计算前N未Geohash的demandfrom pygeohash import encode, decodeimport plotlyimport plotly.plotly as pyfimport plotly.graph_objs as goimport numpy as ...原创 2020-01-16 17:24:25 · 4829 阅读 · 0 评论 -
根据经纬度生成Geohash
#---zhangpengxu---#-*- coding: utf-8 -*-from pygeohash import encode, decodeimport plotlyimport plotly.plotly as pyfimport plotly.graph_objs as goimport numpy as npimport pandas as pdimport m...原创 2020-01-16 15:02:24 · 1687 阅读 · 0 评论 -
Python读取MySQL数据生成热力图
port numpy as npimport pandas as pdimport foliumimport webbrowserfrom folium.plugins import HeatMapimport datetimeimport timeimport pymysql.cursorsimport decimal# 创建一个游标conn = pymysql.connec...原创 2020-01-14 20:05:38 · 677 阅读 · 0 评论 -
Python用plotly画图
import plotly.offline as ofimport plotly.graph_objs as goof.offline.init_notebook_mode(connected=True)trace0 = go.Scatter( x=[1, 2, 3, 4], y=[10, 15, 13, 17], mode='markers')trace1 =...原创 2020-01-14 15:46:54 · 364 阅读 · 0 评论 -
python读取数据写入MySQL数据库
#—zhangpengxu—#-- coding: utf-8 --import datetimeimport timeimport pymysql.cursorsimport decimal创建一个游标conn = pymysql.connect(host=‘localhost’,port=3306,user=‘root’,passwd=‘xu19931026’,db=‘...原创 2020-01-14 11:16:46 · 1057 阅读 · 0 评论 -
机器学习测试002
sort_values函数import datetimeimport pandas as pddf = pd.DataFrame({'col1' : ['A', 'A', 'B', 'F', 'D', 'C'],'col2' : [2, 1, 9, 8, 7, 4],'col3': [0, 1, 9, 4, 2, 3],})print(df)输出:| col1 col2 col3...原创 2020-01-09 09:13:45 · 330 阅读 · 0 评论 -
Python实现Excel生成汇总直方图
# -*- coding: utf-8 -*-import geohash as geohashimport xlwt # 写入excel文件的库import xlrd #读取Excelimport timeimport datetimeimport geohash #把经纬度转换为geohashimport randomstart_time=datetime.datet...原创 2020-01-08 12:10:35 · 2221 阅读 · 0 评论 -
把一个Excel中的经纬度转换为geohash写入另一个Excel
# -*- coding: utf-8 -*-import geohash as geohashimport xlwt # 写入excel文件的库import xlrd #读取Excelimport timeimport datetimeimport geohash #把经纬度转换为geohashstart_time=datetime.datetime.now()han...原创 2020-01-08 09:43:23 · 777 阅读 · 2 评论 -
简单的机器学习
# Regressor example# Code: https://github.com/keloli/KerasPractise/edit/master/Regressor.pyimport numpy as np #NumPy 通常与 SciPy(Scientific Python)和 Matplotlib(绘图库)一起使用, 这种组合广泛用于替代 MatLabnp.random....原创 2020-01-02 16:03:08 · 263 阅读 · 0 评论 -
机器学习
一:无监督学习:应用:聚类(clustering) 降维(dimension reduction)*聚类:两个不同样本之间的相似性:欧式距离:曼哈顿距离:马氏距离:夹角余弦:sklearn.cluster:k-means聚类算法DBSCANGaussian MixturesBirch降维:sklearn中提供7种降维算法sklearn.decompositi...原创 2019-12-31 10:17:55 · 127 阅读 · 0 评论