- 博客(8)
- 收藏
- 关注
原创 python 两个npy档案合并
old_record=numpy.load('exist.npy') temp_record=[] path = os.getcwd()+"\\database\\new" #获取当前路径 for root,dirs,files in os.walk(path): #遍历统计 for each in files: url=path+"\\"+each ... t...
2018-10-17 14:53:19 4077 2
原创 最简单的带参数python函数
import sys def print_something(mes): print(mes) if __name__ == '__main__': if len(sys.argv) != 2: print('missing argv') exit(1) print_something(sys.argv[1]) 如何使用?假设上面存为文档...
2018-10-14 21:49:44 250
原创 python 定义一个类
#以下定义了一个类,类名为Person_info,里面有两个参数,分别是name和age class Person_info: def __init__(self,name,age): self.name=name self.age=age #以下是使用说明 temp=Person_info(kk,5); print(temp.name) print...
2018-10-14 16:44:37 9669
原创 python 计算程序运行的时间
import time start = time.clock() #开始计时 #一大堆程序 elapsed = (time.clock() - start) #结束计时 print("running time:"+str(elapsed)+"s") #印出时间
2018-10-14 16:41:18 1154
原创 python 保存、读取数据
ori=[] numpy.save('ori.npy',ori) #保存数据 load_data= numpy.load('ori.npy') #读取数据
2018-10-14 16:39:09 269
原创 python 重命名文件
def rename_img(path) start = time.clock()#计算程序开始执行 count=0 for root,dirs,files in os.walk(path): #遍历统计 for each in files: url=path+"\\"+each; #原文件的路径+文件名(绝对路径) ...
2018-10-14 16:36:21 1184 4
原创 k-means 二维,C++实现
// k_means.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include <iostream> #include <vector> #include <string> #include <fstream> #include <sstream> u
2018-10-06 23:15:44 371 3
原创 K-means 一维 C++
// k_means.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // #include "pch.h" #include <iostream> #include <vector> #include <string> using namespace std; int main() { cout << "请输入
2018-10-05 20:20:54 640
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人