- 博客(5)
- 收藏
- 关注
原创 rdkit计算
import osimport rdkitimport pandas as pdfrom rdkit import Chemfrom rdkit.Chem import Descriptorsfrom rdkit.ML.Descriptors import MoleculeDescriptorspath=‘POSCAR-2’mols=[]files= os.listdir(path)for file in files:mol = Chem.MolFromMolFile(path+’/’+
2021-03-02 15:51:28 327
原创 python实现搜索文件名称,然后复制文件的简洁版本
impor shutilfor dirpath, dirnames, filenames in os.walk(source_dir): #历遍文件夹 if file in filenames: source_path = str(dirpath) + r'/' + str(file) shutil.
2021-01-27 14:32:44 168
原创 把多个列表的数据输出到CSV表格
name=[]DATA1= []head= ['name', 'DATA1']list = [name,DATA1]list_change = numpy.transpose(list) test = pd.DataFrame(columns=head, data=list_change)test.to_csv('name.csv')
2020-11-26 12:44:02 1417
原创 python 第三方库安装调用镜像
第一条:anaconda 安装第三方库问题:1.建议使用anaconda下自带的功能2.安装缓慢时使用镜像conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config --set show_chan
2020-11-21 11:10:25 380
原创 实用的python脚本汇总
脚本1批量在文件的第一行替换为文件名import ospath='POSCAR'files= os.listdir(dir)for file in files: path_mol=path+'/'+file path_mol2=path+'-2'+'/'+file content = open(path_mol, 'r') contnt_replace = open(path_mol2, 'w') line = content.readlines()
2020-10-21 12:55:37 176
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人