Python-总结与学习
文章平均质量分 59
11小零童
这个作者很懒,什么都没留下…
展开
-
Dijkstra’s algorithm-Python代码实现
Saving in Hash Table graph = {} #因为里面嵌套太多hash table所以不从start开始,把start作为parent的node的距离作为其本身cost graph['A'] = {} graph['A']['Fin'] = 1 graph['B'] = {} graph['B']['A'] = 3 graph['B']['Fin'] = 5 graph['Fin'] = {} infinity = float("inf") costs ={} costs['A'原创 2021-02-23 01:41:13 · 122 阅读 · 0 评论 -
Pandas——数据操作
对数据进行描述的操作 1. 对于numerical 变量: reviews.points.describe() Out: count 129971.000000 mean 88.447138 ... 75% 91.000000 max 100.000000 Name: points, Length: 8, dtype: float64 2. 对于其他变量:只显示可用的功能 例如Out: count原创 2021-02-19 01:33:30 · 116 阅读 · 0 评论 -
Pandas Library 总结——获取,保存,访问
读,写,存储操作 Import import pandas as pd Creating data 1. 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 · 354 阅读 · 0 评论 -
Data Visualisation 整理总结-Python
Data Visualisation 整理总结 Plot的主要结构 #设定figure大小 plt.figure(figsize = (12,6)) #各种plot的方法 #。。。。 # (需要的话)Add label for vertical axis plt.xlabel("Genre") #add title plt.title("Average Game Score, by Platform and Genre") 分类: 1. 为了显示Trends A trend is defined as原创 2021-02-17 05:56:36 · 579 阅读 · 0 评论