用于读取数据文件的包
data-p的Python项目详细描述
python的data_y-py包,用于读取由空格或任何其他字符分隔的多个列的数据文件
安装命令:
pip install data-py
使用示例:
from data_py import datafile
NoOfLines=0
lineNumber=2 # Line number to read (Excluding lines starting with '#')
df1=datafile("C:/Folder/SubFolder/data-file-name.txt")
df1.separator="," # No need to specify if separator is space(" ") and for 'tab' separated values use '\t'
NoOfLines=df1.lines # Total number of lines in the data file (Excluding lines starting with '#')
[Col1,Col2,Col3,Col4,Col5]=["","","","",""] # Initial values
[Col1,Col2,Col3,Col4,Col5]=df1.read([Col1,Col2,Col3,Col4,Col5)],lineNumber)
print(Col1,Col2,Col3,Col4,Col5) # In str format
有关详细信息,请访问链接https://www.respt.in/p/python-package-datapy.html
- 项目
标签: