Skip to content

Instantly share code, notes, and snippets.

@miguelgarcia
Last active October 2, 2018 23:13
Show Gist options
  • Save miguelgarcia/12ddeaead59164c42b298b48141c720d to your computer and use it in GitHub Desktop.
Save miguelgarcia/12ddeaead59164c42b298b48141c720d to your computer and use it in GitHub Desktop.
For each row apply a different weight to each column
import numpy
data = numpy.array(
[
[1,2,3,4],
[5,6,7,8],
[9,10,11,12],
]
)
weights = [3.5, 4, 5 ,6]
weighted_data = data * weights
print(weighted_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment