快速将Excel复制的表格文本转换为NumPy数组
Project description
numpytable
每次复制Excel表格的数据到Python中,都要手动添加括号和逗号,非常繁琐。
目的:快速将Excel等工具复制的表格文本转换为NumPy数组,告别手动添加括号和逗号的繁琐操作。
安装
pip install numpytable
用法
-
在Excel(或其他表格工具)中选中数据并复制(元素间默认用制表符分隔):
2.2681 6.623 2.6459 2.3407 6.574 2.1304 2.8451 6.4258 2.1178 -
在Python中用
from_table函数转换:import numpy as np from numpytable import from_table # 直接粘贴复制的文本,用三引号包裹 data = np.array(from_table(""" 2.2681 6.623 2.6459 2.3407 6.574 2.1304 2.8451 6.4258 2.1178 """)) print(data) # 输出: # [[2.2681 6.623 2.6459] # [2.3407 6.574 2.1304] # [2.8451 6.4258 2.1178]]
特性
- 自动处理换行和制表符,无需手动格式化
- 支持整数、浮点数自动识别
- 检测并警告行数不一致的情况
- 轻量依赖(仅需numpy)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
numpytable-0.1.0.tar.gz
(4.3 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 numpytable-0.1.0.tar.gz.
File metadata
- Download URL: numpytable-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac915ea4d3a41757ab8d0dcbcc2944bef5460539d4272f0b173a924780cde567
|
|
| MD5 |
948426e15541ef5ffec6ecc2939fc23a
|
|
| BLAKE2b-256 |
25e10a76f62ea1ddd48f6788d4375e7e17903d4f37dcaa992da0107c382b49d5
|
File details
Details for the file numpytable-0.1.0-py3-none-any.whl.
File metadata
- Download URL: numpytable-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
760cf6175066d459d4c86b3aa2f65ecb28c26ce3443bd4e3359eb0660882c9c8
|
|
| MD5 |
fe85d2382e16ade33cc1be412772ccd8
|
|
| BLAKE2b-256 |
02eb99d9bff7ea7a46a72c8c996273a1f290736c3b6e8064f0b4841a70d26c7b
|