摘要: DataFrame的基本操作 1,选择 (1),Select column In [11]: df['a']Out[11]:0 -1.3552631 0.0108882 1.5995833 0.0045654 0.460270Name: a, dtype: float64(2),Select row by label In [15]: df... 阅读全文
posted @ 2014-06-28 09:20 sxcww 阅读(379) 评论(0) 推荐(0) 编辑
摘要: QMessageBox中的四种对话框 ui_dialogtest.h文件: /********************************************************************************** Form generated from reading UI file 'dialogtest.ui'**** Created by: Qt Us... 阅读全文
posted @ 2014-06-26 16:43 sxcww 阅读(5690) 评论(0) 推荐(0) 编辑
摘要: qsort() 参考:http://www.slyar.com/blog/stdlib-qsort.html qsort包含在头文件中,此函数根据你给的比较条件进行快速排序,通过指针移动实现排序。排序之后的结果仍然放在原数组中。使用qsort函数必须自己写一个比较函数。 函数原型:void qsort (void * base, size_t num, size_t size, int ( ... 阅读全文
posted @ 2014-06-16 08:55 sxcww 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return – –321 #include#includeusing namespace std;class Solution {private: bool myError; void setErro... 阅读全文
posted @ 2014-06-11 22:08 sxcww 阅读(211) 评论(0) 推荐(0) 编辑
摘要: post:from urllib.error import URLError,HTTPError import urllib.request import urllib.parse url='http://www.wunderground.com/cgi-bin/findweather/get... 阅读全文
posted @ 2014-06-11 16:38 sxcww 阅读(462) 评论(0) 推荐(0) 编辑
摘要: # -- coding: utf-8 --#自定义异常class myException(Exception): passdef division(x,y): if y == 1 : raise myException('y==1') #假如当y==1时,抛出自定义异常 return x/ytry: division(1,0)except ZeroDi... 阅读全文
posted @ 2014-06-08 17:03 sxcww 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 由ip查域名:(family, type, proto, canonname, sockaddr)=socket.getaddrinfo(host, port, family=0, type=0, proto=0, flags=0)#-*- coding='gb2312' -*-import soc... 阅读全文
posted @ 2014-06-08 16:03 sxcww 阅读(185) 评论(0) 推荐(0) 编辑
摘要: server:# -*- coding:gb2312 -*-import socketimport timeif __name__ == "__main__": s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) host='' p... 阅读全文
posted @ 2014-06-07 16:43 sxcww 阅读(141) 评论(0) 推荐(0) 编辑
摘要: server:# -*- coding:gb2312 -*-import socketimport timeimport structif __name__ == "__main__": s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) ... 阅读全文
posted @ 2014-06-07 16:29 sxcww 阅读(213) 评论(0) 推荐(0) 编辑
摘要: In [8]: b=b'hello'In [9]: type(b)Out[9]: builtins.bytesIn [10]: s='hello'In [11]: type(s)Out[11]: builtins.strTo convert from str to bytes, use str.encode().: In [12]: a=str.encode(s)In [13]: t... 阅读全文
posted @ 2014-06-07 16:20 sxcww 阅读(168) 评论(0) 推荐(0) 编辑