自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 python字符串转数组

import re line = '''{name:'兰州',name:'张掖', geoCoord:[103.73, 36.03]},''' city = re.findall("name:'(\w+)'",line) code = re.findall("\[\d+.\d+,\s\d+.\d+\]", line) # code = re.findall("Coord:\[(\d+.\d+)...

2020-04-15 22:06:25 618

原创 python图搜索深度优先和广度优先的自我理解

def search_graph(network, start): need_check = [start] expansion = [] while need_check: person = need_check.pop(-1) # -1 为深度优先 0 为广度优先 if person in expansion: continue ...

2020-04-15 21:48:45 150

原创 python图结构展示

import networkx as nx import matplotlib.pyplot as plt from pylab import mpl social_network = {'小张': ['老王', '小刘', '小西'], '小西': ['张三','李四','陈八'], '陈八':['小七', '王五']} mpl.rcParams['font.sans-serif'] = [...

2020-04-13 22:28:04 288

原创 python统计单词出现的次数

from collections import Counter text = 'hello world hello world hello hello world hello world' print(Counter(text.split()) 一些Counter常用的方法 | Counter() | | Note: If a count is set to zer...

2020-04-04 12:37:49 1452 2

空空如也

空空如也

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

TA关注的人

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