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

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

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



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

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

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

پایتون برای مالی در تلگرام https://www.tg-me.com/ar/Python4Finance/com.python4finance
پایتون برای مالی در بله https://ble.im/ar/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: |

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Python4Finance from ar


Telegram Python4Finance
FROM USA