自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 果蝇神经元聚类

#!/usr/bin/env python# -*- coding: utf-8 -*-"""Created on Sep 26 15:28:03 2016@author: HM"""print(__doc__)from sklearn.cluster import KMeansfrom sklearn.decomposition import PCAfrom sklearn.prepro

2016-09-28 16:29:45 439

原创 爱奇艺 2

#!/usr/bin/env python# -*- coding: utf-8 -*-'''小明喜欢玩一款叫做炉石传说的卡牌游戏,游戏规则如下,玩家拥有N颗水晶和M张卡牌,每张卡牌的使用会消耗ai颗水晶并且造成bi的伤害值,请你帮小明算一下该如何使用手上的卡牌,在消耗小于等于N颗水晶的前提下造成最多的伤害值之和。所有输入均为32位正整数第一行N M第二行到第M+1行 ai bi1

2016-09-27 22:14:12 766

转载 回文数(网易笔试)

# -*- coding:utf-8 -*-#不用递归!--人生苦短我用python#首尾指针跟踪#两个数不相等就进行加法:小的数加上相邻的值def huiwen(item, head, tail): times=0 left = item[0] # head = 0 right = item[-1] # tail = n-1 while (head<tail)

2016-09-26 16:38:05 238

原创 给定数组,输出第三大的数的id

#!/usr/bin/env python# -*- coding: utf-8 -*-def fn(): L = [1,3,9,17,97,37,28,45] d = {} for i in range(len(L)): if L[i] not in d: d[L[i]] = i ss= sorted(d.iteritems

2016-09-23 20:20:56 282

原创 9.20练习

# _*_ coding:utf-8 _*_import osfrom pandas import DataFrame,Seriesimport pandas as pdimport numpy as npimport matplotlib.pyplot as pltimport pylabimport json''' # usagov_bitly_data2012-03-16-1331

2016-09-20 17:18:36 548

原创 判断字符串子串数

#!/usr/bin/env python# -*- coding: utf-8 -*-def fn(): strs = raw_input("Enter the string:") d = {} for i in range(len(strs)): for j in range(1,len(strs)): if strs[i]*j

2016-09-20 17:17:51 254

原创 9.19练习

# -*- coding: utf-8 -*-def findchar(string,char): num = len(string) for i in range(-1,-(num+1),-1): ff = cmp(string[i],char) if ff == 0: return i else: r

2016-09-19 18:05:48 365

原创 python str, repr

str一般是将数值转成字符串,而repr只是将一个对象转成字符串显示。In [1]: print repr("Hello")'Hello'In [2]: print str("Hello")HelloIn [3]: print eval(repr("Hello"))Hello

2016-09-18 18:47:11 188

原创 京东算法2

def f(x,y,L): sum = (x-L[0])**2+(y-L[1])**2 return sum if __name__ == "__main__": L1 = [] L2 = [] L3 = [] Lx = [] Ly = [] LL = [] for i in range(3): s = i

2016-09-05 21:03:08 1308

原创 京东算法题1

def f1(n): L1 = [] while n>0: L1.append(n%10) n = n / 10 sum1 = Sum_list(L1) return sum1def f2(n): L2 = [] while n>0: L2.append(n%2) n = n/2

2016-09-05 21:02:23 396

原创 python 多线程

#coding=utf-8import threadingfrom time import ctime,sleepdef Music(func): for i in range(2): print "I was listening to %s. %s \n" %(func,ctime()) sleep(1)def Run(): for i in

2016-09-04 10:40:36 175

原创 从txt文件提取数据(神经元特征)

import numpy as npimport osos.chdir("G:\python")def loadDataSet(fileName): fr = open(fileName) L = [] for line in fr.readlines(): curLine = line.strip().split('\t') if

2016-09-02 09:40:21 578

空空如也

空空如也

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

TA关注的人

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