BraveZhao的个人博客分享 http://blog.sciencenet.cn/u/BraveZhao

博文

按标题搜索
Python selenium自动登录网站
2019-6-19 19:37
首次尝试python爬虫,感觉不错: #!/usr/bin/python #-*-coding:UTF-8-*- #byZhiqiang-Zhao #email:zhiqiangzhao@nuaa.edu.cn #specifymodule! fromseleniumimportwebdriver fromselenium.common.exceptionsimportT ...
个人分类: Python|1982 次阅读|没有评论
Python小code对原文件进行替换
2019-6-17 19:04
import os import fileinput with fileinput.input('tip.data',backup='.bak',inplace=True) as f: for line in f: line = line.rstrip().replace('0.417000','0.5564') &nb ...
个人分类: Python|1597 次阅读|没有评论
水分子模拟之TIP4P/2005
热度 1 2019-6-17 17:13
参考资料: http://www.orsi.sems.qmul.ac.uk/downloads.html Tip4p2005 data文件格式: LAMMPS'data.'description 3atoms 2bonds 1&n ...
个人分类: MD|6454 次阅读|2 个评论 热度 1
Python Numpy 创建数组
2019-6-12 23:17
参考: https://www.runoob.com/numpy/numpy-array-from-existing-data.html numpy.empty numpy.empty 方法用来创建一个指定形状(shape)、数据类型(dtype)且未初始化的数组: numpy.empty(shape,dtype=float,order='C') shape 数组形状 dtype 数据类型, ...
个人分类: Python|2437 次阅读|没有评论
Python NumPy 数组属性
2019-6-12 22:30
ndarray.ndim 秩,用于返回数组的维数 ndarray.shape 数组的维度,对于矩阵,n 行 m 列 ndarray.size 数组元素的总个数,相当于 .shape 中 n*m 的值 ndarray.dtype ndarray 对象的元素类型 ndarray.itemsize ndarray 对象中每个元素的大小,以字节为单位 ndarray.flags ndarray 对象的内存 ...
个人分类: Python|1831 次阅读|没有评论
NumPy 数据类型 dtype
2019-6-12 22:03
本文参考自: https://www.runoob.com/numpy/numpy-dtype.html Numpy支持多种数据类型: bool_ 布尔型数据类型(True 或者 False) int_ 默认的整数类型(类似于 C 语言中的 long,int32 或 int64) intc 与 C 的 int 类型一样,一般是 int32 或 int 64 intp 用于索引的整数类型(类似于 C 的 ssize_t ...
个人分类: Python|7183 次阅读|没有评论
Python Numpy库之Ndarray 对象
2019-6-12 20:43
本文参考自: https://www.runoob.com/numpy/numpy-ndarray-object.html NumPy 最重要的一个特点是其 N 维数组对象 ndarray,它是一系列同类型数据的集合,以 0 下标为开始进行 集合中元素的索引。 ndarray 对象是用于存放同类型元素的多维数组。 ndarray 中的每个元素在内存中都有相同存储大小的区域。 创建一个 n ...
个人分类: Python|1658 次阅读|没有评论
Python linecache用法:随机读取文件指定行
2019-6-12 11:49
本文参考自:http://c.biancheng.net/view/2556.html linecache 模块允许从 Python 源文件中随机读取指定行,并在内部使用缓存优化存储。由于该模块主要被设计成读取 Python 源文件,因此它会用 UTF-8 字符集来读取文本文件。 实际上,使用 linecache 模块也可以读取其他文件,只要该文件使用了 UTF-8 字符 ...
个人分类: Python|2513 次阅读|没有评论

本页有 2 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-25 06:52

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部