摘要: # 不带参数的函数 def printLine(): #输出一条横线 print(" "); #没有返回值 #return; printLine(); # 带参数的函数def printInfo(name, age): print("name is: ", name, "; age is: ", a 阅读全文
posted @ 2019-07-03 16:01 really_really 阅读(162) 评论(0) 推荐(0)
摘要: 注:axis = 0为行操作,axis = 1为列操作。 from pandas import DataFrame; df = DataFrame({ 'age': [21, 22, 23], 'name': ['KEN', 'John', 'JIMI']}); df = DataFrame(dat 阅读全文
posted @ 2019-07-03 15:35 really_really 阅读(239) 评论(0) 推荐(0)
摘要: from pandas import Series; #定义,可以混合定义x = Series(['a', True, 1], index=['first', 'second', 'third']);x = Series(['a', True, 1]); #访问x[1];#根据index访问x['s 阅读全文
posted @ 2019-07-03 15:12 really_really 阅读(280) 评论(0) 推荐(0)
摘要: % #与 | #或 not #非 #取整7 // 4 #求余10 % 4 #乘方2 ** 3 #一个关于浮点数运算需要注意的地方a = 4.2b = 2.1c = a + b # c = 6.300000000000001 from decimal import Decimala = Decimal 阅读全文
posted @ 2019-07-03 14:42 really_really 阅读(107) 评论(0) 推荐(0)