自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 Dijkstra’s algorithm-Python代码实现

Saving in Hash Tablegraph = {}#因为里面嵌套太多hash table所以不从start开始,把start作为parent的node的距离作为其本身costgraph['A'] = {}graph['A']['Fin'] = 1graph['B'] = {}graph['B']['A'] = 3graph['B']['Fin'] = 5graph['Fin'] = {}infinity = float("inf")costs ={}costs['A'

2021-02-23 01:41:13 118

原创 《算法图解》笔记-Breath-first search

Breath-first search(BFs)解决两种问题:Is there a path from node A to node B?A和B之间是否存在路径What is the shortest path from node A to node B?寻找最短路径步骤:1. 用graph表示问题Graph:由nodes和edges构成neighbors: 直接相连的nodesDirected Graph: 定向的,只能由一个方向指向另一个。Undirect

2021-02-20 06:43:06 392

原创 Pandas——数据操作

对数据进行描述的操作1. 对于numerical 变量:reviews.points.describe()Out:count 129971.000000mean 88.447138 ... 75% 91.000000max 100.000000Name: points, Length: 8, dtype: float642. 对于其他变量:只显示可用的功能例如Out:count

2021-02-19 01:33:30 112

原创 Pandas Library 总结——获取,保存,访问

读,写,存储操作Importimport pandas as pdCreating data1. DataFrame是一个table, 其中包含由独立entries组成的array,每一个entry对应于一行和一列表达形式(1)pd.DataFrame({‘列名’:[列中的value1,value2。。。],‘列名2’:[列中的value1,value2。。。]},index=[‘行标签1’,‘2’])pd.DataFrame({'Blue': ['I liked it.', '

2021-02-17 22:42:48 351

原创 Data Visualisation 整理总结-Python

Data Visualisation 整理总结Plot的主要结构#设定figure大小plt.figure(figsize = (12,6))#各种plot的方法#。。。。# (需要的话)Add label for vertical axisplt.xlabel("Genre")#add titleplt.title("Average Game Score, by Platform and Genre")分类:1. 为了显示TrendsA trend is defined as

2021-02-17 05:56:36 563

原创 《算法图解》笔记-Binary Search

@Binary Search AlgorithmBinary Search前提一定要是:A sorted list.算法过程找出中间元素;与target num 进行比较:“=” => 搜索过程结束;middle > target => left = mid-1middle < target => right = mid+1继续循环比较直到 left > right如果在某一步骤数组为空,则代表找不到。代码实现Python

2021-02-06 18:53:09 132 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除