摘要:
# -*- 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-... 阅读全文
摘要:
# -*- 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... 阅读全文
摘要:
# -*- 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... 阅读全文
摘要:
# -*- 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... 阅读全文
摘要:
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... 阅读全文
摘要:
# -*- 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): ... 阅读全文
摘要:
# -*- 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... 阅读全文
摘要:
合并两个数组或者字符串,如果从前往后赋值每个元素,则需要重复移动数字多次,此时可以换着考虑从后往前,可以减少移动次数,从而提高效率# -*- coding: utf-8 -*-"""Created on Fri Feb 24 09:53:42 2017@author: zzpp220"""class ReplaceSpace: def rePlace1(self,s): if ... 阅读全文