Telegram Group & Telegram Channel
اجرای یک تابع بر روی تمام عناصر یک لیست با تابع map

یکی از توابع زیبای پایتون تابع map است. فرض کنید تابعی به نام grade نوشته ایم که در آن نمرات را در قالب اعداد انگلیسی نمایش می دهد. حالا یک لیست از نمرات دانشجویان داریم که می خواهیم آن ها را به اعداد تبدیل کنیم. راه حل متداول این است که با یک حلقه for تمام عناصر این لیست را بخوانیم و تابع را روی آن اجرا کنیم و نتیجه را در یک لیست جدید ذخیره کرده و نمایش دهیم.
اما به کمک تابع map می توانیم این کار را بسیار سریعتر و ساده تر انجام دهیم.
بازنمایی دستورات فوق در پایتون در تصویر این پست ذکر شده است.

پایتون برای مالی در تلگرام https://www.tg-me.com/sg/Python4Finance/com.python4finance
پایتون برای مالی در بله https://ble.im/sg/Python4Finance/com.python4finance



tg-me.com/python4finance/405
Create:
Last Update:

اجرای یک تابع بر روی تمام عناصر یک لیست با تابع map

یکی از توابع زیبای پایتون تابع map است. فرض کنید تابعی به نام grade نوشته ایم که در آن نمرات را در قالب اعداد انگلیسی نمایش می دهد. حالا یک لیست از نمرات دانشجویان داریم که می خواهیم آن ها را به اعداد تبدیل کنیم. راه حل متداول این است که با یک حلقه for تمام عناصر این لیست را بخوانیم و تابع را روی آن اجرا کنیم و نتیجه را در یک لیست جدید ذخیره کرده و نمایش دهیم.
اما به کمک تابع map می توانیم این کار را بسیار سریعتر و ساده تر انجام دهیم.
بازنمایی دستورات فوق در پایتون در تصویر این پست ذکر شده است.

پایتون برای مالی در تلگرام https://www.tg-me.com/sg/Python4Finance/com.python4finance
پایتون برای مالی در بله https://ble.im/sg/Python4Finance/com.python4finance

BY Python4Finance




Share with your friend now:
tg-me.com/python4finance/405

View MORE
Open in Telegram


Python4Finance Telegram | DID YOU KNOW?

Date: |

That strategy is the acquisition of a value-priced company by a growth company. Using the growth company's higher-priced stock for the acquisition can produce outsized revenue and earnings growth. Even better is the use of cash, particularly in a growth period when financial aggressiveness is accepted and even positively viewed.he key public rationale behind this strategy is synergy - the 1+1=3 view. In many cases, synergy does occur and is valuable. However, in other cases, particularly as the strategy gains popularity, it doesn't. Joining two different organizations, workforces and cultures is a challenge. Simply putting two separate organizations together necessarily creates disruptions and conflicts that can undermine both operations.

That growth environment will include rising inflation and interest rates. Those upward shifts naturally accompany healthy growth periods as the demand for resources, products and services rise. Importantly, the Federal Reserve has laid out the rationale for not interfering with that natural growth transition.It's not exactly a fad, but there is a widespread willingness to pay up for a growth story. Classic fundamental analysis takes a back seat. Even negative earnings are ignored. In fact, positive earnings seem to be a limiting measure, producing the question, "Is that all you've got?" The preference is a vision of untold riches when the exciting story plays out as expected.

Python4Finance from sg


Telegram Python4Finance
FROM USA