摘要:在app文件夹下创建database_operations.py文件,写如下内容: import pymysql from 项目名.settings import DATABASES class Database_operat(object): def __init__(self, database 阅读全文
摘要:选款批次: 类目: 查询结果 阅读全文
摘要:在django中使用pandas操作django的ORM查询出来的QuerySet对象,可以使用插件django-pandas。 截止教程书写时间,django-pandas已发布到0.6.1。 依赖:django>=1.4.5 Django-model-utils >=1.4.0 Pandas > 阅读全文
摘要:序号 类目 关键词 操作 {% f... 阅读全文
摘要:1 import pandas as pd 2 import numpy as np 3 4 # merge合并 ,类似于Excel中的vlookup 5 6 df1 = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3'], 7 'A': ['A0', 'A1 阅读全文
摘要:1 2 3 4 5 Title 6 16 17 18 版本号: 19 20 阅读全文
摘要:1 import pandas as pd 2 import numpy as np 3 4 s = pd.Series(['A', 'b', 'c', 'bbhello', '123', np.nan, 'hj']) 5 df = pd.DataFrame({'key1': list('abcde 阅读全文
摘要:1 import pandas as pd 2 import numpy as np 3 4 df = pd.DataFrame({ 5 'key1': [4, 5, 3, np.nan, 2], 6 'key2': [1, 2, np.nan, 4, 5], 7 'key3': [1, 2, 3, 阅读全文
摘要:1 /** 2 * 使用循环的方式判断一个元素是否存在于一个数组中 3 * @param {Object} arr 数组 4 * @param {Object} value 元素值 5 */ 6 function isInArray(arr,value){ 7 for(var i = 0; i < arr.length; i++){ 8 if(va... 阅读全文
摘要:import pandas as pd import numpy as np import names ''' 写在前面的话: 1、series与array类型的不同之处为series有索引,而另一个没有;series中的数据必须是一维的,而array类型不一定 2、可以把series看成一个定长的 阅读全文
摘要:1 import numpy as np 2 3 # 1、快速排序 4 ''' 5 1、np.sort(),不改变原先值的顺序,但是在运行时占内存 6 2、ndarry.sort(),改变原先值的顺序,不占用内存 7 ''' 8 # 不改变n1的顺序 9 n1 = np.array([2, 5, 8, 156, 4, 9, 3]) 10 n2 = np.sort(n1) 11... 阅读全文
摘要:function change_style() { $.ajax({ url: "{% url 'change_style' %}", type: "GET", dataType: 'json', data: {'product_category':$('select.product_categor 阅读全文
摘要:如果是提交表单时,可以通过$('#update_form').serialize(),直接打包提交。 阅读全文
摘要:删除 阅读全文
摘要:var str=new String(); var arr=new Array(); str="ddd,dsd,3,dd,g,k"; //可以用字符或字符串分割 arr=str.split(','); for(var i=0;i<arr.length;i++) { alert(arr[i]); } 阅读全文
摘要:1、 去掉字符串前后所有空格: 代码如下: function Trim(str) { return str.replace(/(^\s*)|(\s*$)/g, ""); } 阅读全文
摘要:1 import numpy as np 2 3 ######################## 4 # 索引 5 n1 = np.random.randint(0, 100, 10) 6 # print(n1) 7 ''' 8 [68 27 40 11 18 6 61 62 67 31] 9 ''' 10 # print(n1[5]) 11 '''... 阅读全文
摘要:1 import numpy as np 2 3 # 创建 4 # 创建一维数组 5 a = np.array([1, 2, 3]) 6 print(a) 7 ''' 8 [1 2 3] 9 ''' 10 # 创建多维数组 11 b = np.array([(1, 2, 3), (4, 5, 6)]) 12 print(b) 13 ''' 14 [... 阅读全文