A package for reading and processing tabular data files for analytical applications
Project description
tablefile package for python for reading a data file with multiple columns separated by space or any other character
Install command:
pip install tablefile
Use example:
from tablefile import *
f1=file("C:/Folder/SubFolder/data-file-name.txt","\t") # Last argument here specifies the column separator (here tab).
# or
f1=file("C:/Folder/SubFolder/data-file-name.txt") #If separator is blank or space (" ") one need not specify separator.
lines=f1.read() # or 'f1.read("l/c")'. This will read all the lines and store in 'lines' as list array
cols=f1.read("c/l")# Will read all the columns and store in 'cols' as list array
average=f1.read("av") # Calculates and stores column-wise average values in a list
sum=f1.read("sm") # Calculates and stores column-wise sum values in a list
std=f1.read("sd") # Calculates and stores column-wise standard deviation for a population in a list
stds=f1.read("sds") # Calculates and stores column-wise standard deviation for a sample in a list
min=f1.read("mn") # Calculates and stores column-wise minimum values in a list
max=f1.read("mx") # Calculates and stores column-wise maximum values in a list
print(lines[i][j]) # Prints column j element of line number i (e.g. for 1st line i=0 and for 1st column j=0)
print(cols[i][j]) # Prints column i element of line number j
print("Average=",average,"Sum=",sum,"Sigma_population=",std,"Sigma_sample=",stds,"Maximum=",max,"Minimum=",min)
# In the below operations the argument can be any 'list'
List_converted=convert(cols[0],'(x**2+sin(x))/2') # converts elements of a list by following any pre-defined expression
Value_sum=sm(cols[0]) # Summation of numeric elements.
Value_av=av(cols[0]) # Average of numeric elements.
Value_sd=sd(cols[0]) # Standard deviation of numeric elements.
Value_sd_sample=sds(cols[0]) # Standard deviation of numeric elements.
Value_mx=mx(cols[0]) # Maximum of numeric elements.
Value_mn=mn(cols[0]) # Minimum of numeric elements.
print(List_converted,Value_sum,Value_av,Value_sd,Value_sd_sample,Value_mx,Value_mn)
# **In all above cases Strings will be neglected during the calculation**
For details please follow the link https://www.respt.in/p/python-package-tablefile.html
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tablefile-0.0.5.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tablefile-0.0.5.tar.gz.
File metadata
- Download URL: tablefile-0.0.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92319da9579b364955e13a5dd8d251e9bfec1228401fc14c0f4650401b859a99
|
|
| MD5 |
d253da8705036e92e3cc4e0e5d84317d
|
|
| BLAKE2b-256 |
a8e50af8aa699023db5932d0536d21e0aaa6492df7af87298918c40eb6964142
|
File details
Details for the file tablefile-0.0.5-py3-none-any.whl.
File metadata
- Download URL: tablefile-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
826e903d2d5ac3ff40447a3f216863874d877f9adb2b23f819fed1b358b4a88a
|
|
| MD5 |
954914b3d640315ea98e397a6338ff04
|
|
| BLAKE2b-256 |
de5927f2d462a5909503d100ecd4f65241fe9c35d57edcf6a800202a6d23a950
|