11 2020 档案
摘要:import pandas as pd #写入 list = [[1, 2, 3], [4, 5, 6], [7, 9, 9]] name = ['one', 'two', 'three'] test = pd.DataFrame(columns=name, data=list) # 数据有三列,列
阅读全文
摘要:csv.read with open("test.csv", "r", encoding = "utf-8") as f: reader = csv.reader(f) rows = [row for row in reader] csv.write with open(file, 'w', new
阅读全文
摘要:`KFold(n_splits=5, shuffle=True, random_state=3)`
阅读全文
摘要:读取csv文件 data = pd.read_csv(f1,nrows =20) s = data.loc[:, :] s = s.loc[:, ['machine_id', 'question_id', 'answer_right']] s = s.values s = s.tolist() 读取
阅读全文
摘要:预处理excel文件中的数据不平衡问题 data = pd.read_excel ("file) list_label = [] train_list, dev_list, test_list = [],[],[] data_value = data.value for i in range(len
阅读全文
摘要:通过list写入excel list1 = [['张三','男','未婚',20],['李四','男','已婚',28],['小红','女','未婚',18],['小芳','女','已婚',25]] output = open('data.xls','w',encoding='gbk') outpu
阅读全文
摘要:shutil.rmtree(params.save) #删除文件保存相关文件 os.mkdir(params.save) #创建相关文件 torch.save(model, params.save+'/model.pkl') #以torch为例子,然后保存 def delete_file(path)
阅读全文
摘要:f1 = metrics.f1_score(all_target, all_pred)
阅读全文
摘要:df.groupby(['opponent']).game_id.nunique()= for index,group in df.groupby(df['opponent'])['game_id']: print(index) print(len(set(list(group))))
阅读全文
摘要:nohup venv/bin/python bin/photo_data.py > ph_save.log 2>&1 & 或者 nohup python -u test.py > test.log 2>&1 & sh 文件nohup sh test.sh > test.log 2>&1 & 查看进程
阅读全文
摘要:1. git status 查看修改的文件1. 首先add: `git add file` 提交需要修改的文件2. 删除`master`分支: `git commit -m '' `3. 拉取分支: `git pull origin dev_lhh`4. diff: `git diff dev_lh
阅读全文