How to Do Elementwise Math in Python

preview_player
Показать описание
This video shows how to perform elementwise math operations using base python lists, numpy arrays and on the columns of pandas dataframes.

If you find this video useful, like, share and subscribe to support the channel!

Code used in this Python Code Clip:

# Elementwise math on two lists using zip

list1 = [1,2,3,4,5]
list2 = [6,7,8,9,10]

elementwise_result = [l1 + l2 for l1, l2 in zip(list1, list2)]

elementwise_result

# Elementwise math using numpy arrays

import numpy as np

list1 + list2

# Elementwise math on columns in pandas data frames

import pandas as pd

df = pd.DataFrame(data = {"list1": list1, "list2" : list2})

* Note: YouTube does not allow greater than or less than symbols in the text description, so the code above will not be exactly the same as the code shown in the video! I will use Unicode large < and > symbols in place of the standard sized ones. .

Рекомендации по теме
Комментарии
Автор

Simple, straightforward, easy. Great stuff! Thanks a lot!

lastfm
Автор

I have been facing problems for the last 7 days, and finally, I got the solution from this video. Thanks

sandeepjaggi
Автор

this is an amazing video. no body does such videos and I want this type specifically. for 2D and n- Dimensions matrix , like matrix multiplication, convolution etc. in python, then numpy and so on. please make such a video. thanks!

vigneshpadmanabhan
Автор

Next video at the end is Naruto power lvl. pretty cool, but it is not the next video in list.

angeloploscariu