摘要: data = '苹果.葡萄.txt' print(data.split('.')[len(data.split('.'))-1]) 输出 txt 阅读全文
posted @ 2020-04-27 15:47 略略略额 阅读(6841) 评论(0) 推荐(0)
摘要: from django.core.paginator import Paginator,PageNotAnInteger,EmptyPage def publishArticles(request): if(request.method=="GET"): page = request.GET['pa 阅读全文
posted @ 2019-12-31 15:11 略略略额 阅读(328) 评论(0) 推荐(0)
摘要: view.py与urls.py中的请求方法配置好了之后,在iframe调用,报如下错误: Refused to display 'http://localhost:8000/welcome' in a frame because it set 'X-Frame-Options' to 'deny'. 阅读全文
posted @ 2019-12-30 14:58 略略略额 阅读(762) 评论(0) 推荐(0)
摘要: pandas.Series(data=None, index=None, dtype=None, name=None, copy=False, fastpath=False) # data: 数组,Iter,字典或标量值,包含存储在系列中的数据。在0.23.0版中进行了更改:如果data是dict, 阅读全文
posted @ 2019-12-25 16:49 略略略额 阅读(151) 评论(0) 推荐(0)
摘要: import numpy as np a = np.arange(10,20,1) b = slice(1,5,2) d = a[1:5:2] e = a[2:] print(a) print(a[b]) print(d) print(e) #结果 [10 11 12 13 14 15 16 17 阅读全文
posted @ 2019-12-25 11:23 略略略额 阅读(154) 评论(0) 推荐(0)
摘要: # 单继承 class GrandP(): print('GrandP') class Father(GrandP): print('Father') class Son(Father): print('Son') Son() #结果 GrandP Father Son # 多继承 class Fa 阅读全文
posted @ 2019-12-25 09:58 略略略额 阅读(121) 评论(0) 推荐(0)
摘要: numpy.arange numpy 包中的使用 arange 函数创建数值范围并返回 ndarray 对象,函数格式如下: numpy.arange(start, stop, step, dtype) 根据 start 与 stop 指定的范围以及 step 设定的步长,生成一个 ndarray。 阅读全文
posted @ 2019-12-24 14:34 略略略额 阅读(343) 评论(0) 推荐(0)
摘要: class Counter(object): def __init__(self): self.i = [1,2,3,4,5,6] self.n = iter(self.i) def __call__(self): x = next(self.n) print('call',x) return x 阅读全文
posted @ 2019-12-24 11:19 略略略额 阅读(252) 评论(0) 推荐(0)
摘要: numpy.asarray 类似 numpy.array,但 numpy.asarray 参数只有三个 numpy.asarray(a, dtype = None, order = None) 参数说明: 参数 描述 a 任意形式的输入参数,可以是,列表, 列表的元组, 元组, 元组的元组, 元组的 阅读全文
posted @ 2019-12-24 10:37 略略略额 阅读(985) 评论(0) 推荐(0)
摘要: numpy.empty numpy.empty 方法用来创建一个指定形状(shape)、数据类型(dtype)且未初始化的数组: numpy.empty(shape, dtype = float, order = 'C') 参数说明: 参数 描述 shape 数组形状 dtype 数据类型,可选 o 阅读全文
posted @ 2019-12-23 18:25 略略略额 阅读(266) 评论(0) 推荐(0)