摘要: # -*- coding: utf-8 -*-"""Created on Wed Feb 15 20:36:15 2017@author: zzpp220"""import json,sysfrom pandas import DataFrame,Seriesimport pandas as pdimport numpy as np#=======================dataset1-... 阅读全文
posted @ 2017-02-28 22:17 zx0801 阅读(384) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-"""Created on Tue Feb 21 15:17:51 2017@author: zzpp220"""'''合并(merge)-列或者连接(concat)-行数据集'''from pandas import DataFrame,Seriesfrom numpy import nan as NaNimport pandas as pdimpo... 阅读全文
posted @ 2017-02-28 22:16 zx0801 阅读(260) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-"""Created on Fri Feb 17 15:04:50 2017@author: zzpp220"""from pandas import DataFrame,Seriesfrom numpy import nan as NaNimport pandas as pdimport numpy as npimport pandas.io.dat... 阅读全文
posted @ 2017-02-28 22:16 zx0801 阅读(262) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-"""Created on Tue Feb 21 22:07:13 2017@author: zzpp220"""from pandas import DataFrame,Seriesfrom numpy import nan as NaNimport pandas as pdimport numpy as npdf=DataFrame({'k1':l... 阅读全文
posted @ 2017-02-28 22:15 zx0801 阅读(473) 评论(0) 推荐(0) 编辑
摘要: class TreeNode: def __init__(self,data,left,right): self.data=data self.left=left self.right=right方法1def construct_tree(pre_order,mid_order):##保证结点数不为0,该树才能重构 if (len(pre_or... 阅读全文
posted @ 2017-02-28 22:12 zx0801 阅读(352) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-"""Created on Tue Feb 28 09:10:19 2017@author: zzpp220"""class LinkList: def __init__(self,val,link=None): self.val=val self.link=link def __del__(self): ... 阅读全文
posted @ 2017-02-28 22:08 zx0801 阅读(207) 评论(0) 推荐(0) 编辑
摘要: # -*- coding: utf-8 -*-"""Created on Mon Feb 27 09:06:07 2017@author: zzpp220"""class LinkList: def __init__(self,val,link=None): self.val=val self.link=link def printReversely(sel... 阅读全文
posted @ 2017-02-28 22:08 zx0801 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 合并两个数组或者字符串,如果从前往后赋值每个元素,则需要重复移动数字多次,此时可以换着考虑从后往前,可以减少移动次数,从而提高效率# -*- coding: utf-8 -*-"""Created on Fri Feb 24 09:53:42 2017@author: zzpp220"""class ReplaceSpace: def rePlace1(self,s): if ... 阅读全文
posted @ 2017-02-28 22:07 zx0801 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #==============================================================================# # -*- coding: utf-8 -*-# """# Created on Mon Feb 20 10:48:50 2017# # @author: zzpp220# """'''排序算法---快速排序'''__metadata__... 阅读全文
posted @ 2017-02-23 22:42 zx0801 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 思路: 把一个整数和他减1后的数做位于运算,得到的结果(以10进制的整数给出)相当于把原整数的二进制表示中最右端的1变为0,很多问题都可以这么解决。<!--more--> 2的幂 乘2 除2 2的幂指数次放都可以转化为该数的二进制表示方法 左移 右移 二进制中1的个数 把整数右移 左移 1位和把整数 阅读全文
posted @ 2017-02-23 22:41 zx0801 阅读(434) 评论(0) 推荐(0) 编辑