Skip to main content

pandas-fast-nested-looper

Project description

v0.0.6

Суулгах:

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

https://medium.com/@mflova/making-python-extremely-fast-with-numba-advanced-deep-dive-2-3-f809b43f8300

Ашиглах заавар:


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas_fast_nested_looper-0.0.6.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_fast_nested_looper-0.0.6-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pandas_fast_nested_looper-0.0.6.tar.gz.

File metadata

File hashes

Hashes for pandas_fast_nested_looper-0.0.6.tar.gz
Algorithm Hash digest
SHA256 cd400bf933d93eb4658bfe0d3de6ccf28d05229c1c1c2129e9b8838b11a2b930
MD5 1f3640d8902eb3213dde6e933f6065bf
BLAKE2b-256 1e293127f4960719a3568e5f635902d6d4443bea5da2a7573953844bb6efcfe1

See more details on using hashes here.

File details

Details for the file pandas_fast_nested_looper-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pandas_fast_nested_looper-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 21e841364776cf9bc0d650d36451d861ca784b6f71c0db017591fad772f7ac33
MD5 6afb11595edef5496567f4c4fab434b9
BLAKE2b-256 52d3eef4eb2579a5d50b8dc919df680a0fff72c262fbb1939c9adc66dec56fc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page