Skip to main content

pandas-fast-nested-looper

Project description

Суулгах:

https://github.com/ganbaaelmer/pandas-fast-nested-looper.git

https://pypi.org/project/pandas-fast-nested-looper

эсвэл


pip install pandas-fast-nested-looper

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


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)

Үр дүн:

file2_column_B_list лист үүснэ

file2_df dataframe дотор таны өгсөн file2_new_column_name багана бүхий мэдээлэл үүснэ

df2_with_new_column.csv файл диск дээр үүснэ.

Тайлбар:

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

Анхаарах зүйлс:

  • 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.2.tar.gz (4.4 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.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pandas_fast_nested_looper-0.0.2.tar.gz
Algorithm Hash digest
SHA256 747473b8d418d32854fb33b99d6d1bbf6d6ced5dda69f3b786248f3966076d04
MD5 6aa3e8b64456fcf7cbf1093e0fc5e903
BLAKE2b-256 c8cf8f3805da3c6cf1677b5eb6ae51f1d6ab743766f7f458f696b64ba5d810b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pandas_fast_nested_looper-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ebe10231c5d4886708ef11cc3b74fc6af65149a7730a4db03385a0413779ea42
MD5 4d591753fb1532d5d87abedd95a42b51
BLAKE2b-256 75798288d0206f7f5c623726d73cb1f434dd8fbf626d28025fbcc18e72379969

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