v0.0.9
Суулгах:
https://github.com/ganbaaelmer/pandas-fast-nested-looper.git
https://pypi.org/project/pandas-fast-nested-looper
эсвэл
pip install pandas-fast-nested-looper
Тайлбар:
2 өөр pandas dataframe ийн тоон утгатай багануудын хооронд хийгддэг асар олон тооны давталттай for loop ээс үүсэх урт хугацааг numba ашиглан хэмнэх зорилготой хийсэн болно.
Numba ашигласнаар том хэмжээний for loop ийг гүйцэтгэх хурд нь numba тохиргоо болон cpu, gpu ашигласанаас хамаарч 110%-477%-р хурдасдаг.
Их хэмжээний дата дээр хийгдсэн for loop давталтуудын хугацааны ялгааг эндээс харна уу:
https://www.codearmo.com/python-tutorial/speed-looping-through-pandas-dataframe-numba
Ашиглах заавар:
from pandas_fast_nested_looper import pandas_fast_nested_looper
file1_name = "your_file1.csv"
file2_name = "your_file2.csv"
file1_column_A = 'your_file1_column_A'
file1_column_B = 'your_file1_column_B'
file2_column_A = 'your_file2_column_A'
file2_new_column_name = "your_file2_new_column_name"
file2_column_B_list, file2_df = pandas_fast_nested_looper.pandas_fast_nested_looper(file1_name, file1_column_A, file1_column_B, file2_name, file2_column_A, file2_new_column_name)
Үндсэн үйлдэлүүд:
option1:
for i in range(file2_column_A.shape[0]):
for i in range(file1_column_A.shape[0])
if file1_column_A[i] == file2_column_A[j]:
file2_column_B_list[i] = file1_column_B[j]
else:
pass
option2:
...
Үр дүн:
file2_column_B_list лист үүснэ
file2_df dataframe дотор таны өгсөн file2_new_column_name багана бүхий мэдээлэл үүснэ
df2_with_new_column.csv файл диск дээр үүснэ.
Анхаарах зүйлс:
- numpy болон numba ашиглаж байгаа учир зөвхөн тоон утгатай багануудын хооронд үйлдэл хийдэг.
Metadata
Release files for pandas-fast-nested-looper 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pandas_fast_nested_looper-0.0.9.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pandas_fast_nested_looper-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / pandas_fast_nested_looper-0.0.9.tar.gz
| Download URL | pandas_fast_nested_looper-0.0.9.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6de7fc6aff6b464fa0cf7e983cb04c4bc8fc92a2eaffb753ade2206b1354a1cf
|
|
BLAKE2b-256 checksum How to use checksums |
26a7b6a439a0864a4c7e45adcec12f8580a70ebb705437fb26b43ae7d7b7d98d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|
Release files / pandas_fast_nested_looper-0.0.9-py3-none-any.whl
| Download URL | pandas_fast_nested_looper-0.0.9-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88ee0f88b2235a9a5d967dad8d967e0ac905abd708c79476ceb7ad7a91e85d26
|
|
BLAKE2b-256 checksum How to use checksums |
229038ede13893beb6ada8e4c69bd9ea83b7abf51edb381a3d1992919c7c4f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.9
|