pandas-fast-nested-looper
Project description
v0.0.7
Суулгах:
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 ашиглаж байгаа учир зөвхөн тоон утгатай багануудын хооронд үйлдэл хийдэг.
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
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 pandas_fast_nested_looper-0.0.7.tar.gz.
File metadata
- Download URL: pandas_fast_nested_looper-0.0.7.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95d7071a27afdfb9b7ae434247b058dca4a08d75b485da45d49af2936cda2c31
|
|
| MD5 |
d5ca4c47478c4599a320ab400772a92f
|
|
| BLAKE2b-256 |
08512d73ade7e455a602d529490713339d39c0b26565035b2d0c8600b3fec186
|
File details
Details for the file pandas_fast_nested_looper-0.0.7-py3-none-any.whl.
File metadata
- Download URL: pandas_fast_nested_looper-0.0.7-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51b56f5967f3857e80a2d0c50f9c3af107172841539fdcdbcbdc0898393768aa
|
|
| MD5 |
cebac09945446fa0ec97a89ee3f81c10
|
|
| BLAKE2b-256 |
2047ac1bafa051d7fcd7f2184034e2221dac2a62c8dee6ef20ed32bfd700a616
|