06 2018 档案

摘要:import numpy as npimport cv2from scipy import ndimagek33=np.array([[-1,-1,-1], [-1,8,-1], [-1,-1,-1]])k... 阅读全文
posted @ 2018-06-29 11:11 luoganttcc 阅读(257) 评论(0) 推荐(0) 编辑
摘要:import numpy as npimport cv2from scipy import ndimagek33=np.array([[-1,-1,-1], [-1,8,-1], [-1,-1,-1]])k... 阅读全文
posted @ 2018-06-29 11:00 luoganttcc 阅读(132) 评论(0) 推荐(0) 编辑
摘要:import tensorflow as tf #导入tensorflowa=tf.constant([[1,2]]) #定义了一个1×2的矩阵b=tf.constant([[2], [4]]) #定义了一个2×1的... 阅读全文
posted @ 2018-06-28 22:59 luoganttcc 阅读(69) 评论(0) 推荐(0) 编辑
摘要:文章1文章2 阅读全文
posted @ 2018-06-28 22:48 luoganttcc 阅读(60) 评论(0) 推荐(0) 编辑
摘要:a=[5,4,2,3,1]print(a)n=len(a)l=0r=n-1while True: if a[l]>a[r]: a[l],a[r]=a[r],a[l] r=r-1 if l==r: l=l+1 ... 阅读全文
posted @ 2018-06-27 11:47 luoganttcc 阅读(78) 评论(0) 推荐(0) 编辑
摘要:import heapq#-*- coding: UTF-8 -*-import numpy as npdef MakeHeap(a): for i in range(int(a.size / 2) - 1, -1, -1):#对非叶子节点的子节点进行... 阅读全文
posted @ 2018-06-27 10:43 luoganttcc 阅读(137) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Tue Jun 26 22:32:27 2018@author: luogan"""class Node(object): def _... 阅读全文
posted @ 2018-06-27 09:49 luoganttcc 阅读(303) 评论(0) 推荐(0) 编辑
摘要:我确定很多人不能真正的理解二叉树……class Node: def __init__(self,value=0,left=0,right=0): self.value=value self.left=left ... 阅读全文
posted @ 2018-06-26 22:30 luoganttcc 阅读(308) 评论(0) 推荐(0) 编辑
摘要:class Student(object): def __init__(self, name, score): self.name = name self.score = scorest=Student('lg',99)pr... 阅读全文
posted @ 2018-06-26 13:45 luoganttcc 阅读(86) 评论(0) 推荐(0) 编辑
摘要:nums = [3,1,2]n=len(nums)for i in range(n-1): for j in range(n-i-1): if nums[j]>nums[j+1]: nums[j+1],nums[j]... 阅读全文
posted @ 2018-06-26 13:42 luoganttcc 阅读(77) 评论(0) 推荐(0) 编辑
摘要:import time t1=time.time()def factorial(n): if n==1 or n==2: return 1 else: return factorial(n-1)+factorial(n... 阅读全文
posted @ 2018-06-26 10:27 luoganttcc 阅读(502) 评论(0) 推荐(0) 编辑
摘要:def jiec(n): if n==0: return 1 else: return n*jiec(n-1)ss=jiec(10)print(ss)3628800 阅读全文
posted @ 2018-06-26 10:05 luoganttcc 阅读(271) 评论(0) 推荐(0) 编辑
摘要:c=[]def dcc(dic): for key in dic.keys(): print (key) c.append(key) vv=dic[key] #判断下一级是... 阅读全文
posted @ 2018-06-26 10:03 luoganttcc 阅读(138) 评论(0) 推荐(0) 编辑
摘要:写在之前…从这篇文章开始,我的下一个算法职业生涯方向将专注于推荐算法…看了那么多书和代码,还是peter 的那本>最为经典,说实话很多中国人写的书确实不怎么样…那么,开始吧.本文代码从赵志勇的那本书上修改而来,估计赵志勇的那篇文章也是从>那本书修改而来,反正... 阅读全文
posted @ 2018-06-24 16:23 luoganttcc 阅读(222) 评论(0) 推荐(0) 编辑
摘要:def PowerSetsRecursive(items): """Use recursive call to return all subsets of items, include empty set""" if len(items)... 阅读全文
posted @ 2018-06-23 21:48 luoganttcc 阅读(332) 评论(0) 推荐(0) 编辑
摘要:kk=5def factorial(n): result = 1 for i in range(2, n+1): result *= i return resultprint(factorial(kk))def factori... 阅读全文
posted @ 2018-06-23 21:44 luoganttcc 阅读(89) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Sat Jun 23 16:59:07 2018@author: luogan"""def PowerSetsBinary(items): ... 阅读全文
posted @ 2018-06-23 17:12 luoganttcc 阅读(342) 评论(0) 推荐(0) 编辑
摘要:文章链接 阅读全文
posted @ 2018-06-23 16:32 luoganttcc 阅读(75) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Wed Jun 20 21:02:58 2018@author: luogan"""#coding=UTF-8from numpy impo... 阅读全文
posted @ 2018-06-20 21:11 luoganttcc 阅读(164) 评论(0) 推荐(0) 编辑
摘要:import pandas as pdimport pymysqlfrom sqlalchemy import create_engine#engine = create_engine("mysql+pymysql://user:password@host:... 阅读全文
posted @ 2018-06-19 22:36 luoganttcc 阅读(559) 评论(0) 推荐(0) 编辑
摘要:import pymysql.cursors#连接配置信息config = {'host':'127.0.0.1','port':3306,'user':'root','password':'08300734','db':'db','charset':'ut... 阅读全文
posted @ 2018-06-19 22:27 luoganttcc 阅读(230) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Fri Jun 8 16:27:57 2018@author: luogan"""import pandas as pdfrom pysp... 阅读全文
posted @ 2018-06-09 12:38 luoganttcc 阅读(1340) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示