Skip to main content

pandas-fast-nested-looper

Project description

Суулгах:

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

эсвэл


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%-р багасдаг.

Жишээ нь: Numba ашиглан 222,746,218,752 давталтыг 15 минутад хийж гүйцэтгэсэн. 247,495,798 it/s гэсэн үг юм.

Их хэмжээний дата дээр хийгдсэн for loop давталтуудын хугацааны ялгааг эндээс харна уу:

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.1.tar.gz (8.1 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.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pandas_fast_nested_looper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9055d65b7958b5b77b6bb2399c5ddac0f5fe56a5619bc0b1f546568598a36a07
MD5 01f7aad600f08ce46b8f7a3176e13831
BLAKE2b-256 4af0fec17a076d22480aac15956d9f5670c746fec9dc59d31f5769eea3d90b49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pandas_fast_nested_looper-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75a58b0fa041e2bd7b17a4bd0592005eb0d947bef6dbe2612afc7b109d091ae8
MD5 1f140bdad8a6dbe124cfbfb75968b4f5
BLAKE2b-256 54a9a99e146892b15371b2617ca3f40d7b8845dad938e8e26a256f1219279086

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