Guest User

Python numpy problem

a guest
Dec 9th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.34 KB | None | 0 0
  1. import numpy as np
  2.  
  3. weird_list = [800153196,
  4.              946067665,
  5.              827629917,
  6.              868941741,
  7.              875745873,
  8.              926109150,
  9.              1353347195,
  10.              1003235074,
  11.              1053666891,
  12.              1442194993,
  13.              1924716858,
  14.              1060724069,
  15.              1182240731,
  16.              1646547575,
  17.              1215762661,
  18.              1520107722,
  19.              1512568609,
  20.              1534064291,
  21.              1549459216,
  22.              1773697582,
  23.              1853820087,
  24.              1696910852,
  25.              1563415785,
  26.              1692314635,
  27.              1627783113]
  28.  
  29. low_list = [0, 1, 2, 3]
  30. ex_list = []
  31. weird_list_div_10 = []
  32. weird_list_mult_10 = []
  33.  
  34. for i in range(len(weird_list)):
  35.     ex_list.append(i)
  36.     weird_list_div_10.append(weird_list[i] // 10)
  37.     weird_list_mult_10.append(weird_list[i] * 10)
  38.  
  39. def array_sum(i_list):
  40.     i_array = np.array(i_list)
  41.     print(i_array)
  42.  
  43.     i_array_rs1 = i_array.reshape(1, -1)
  44.     print(i_array_rs1)
  45.  
  46.     i_array_rs2 = i_array.reshape(-1, 1)
  47.     print(i_array_rs2)
  48.  
  49.     i_array_rs_SUM = i_array_rs1 + i_array_rs2
  50.     print(i_array_rs_SUM)
  51.  
  52. # Some runs
  53. array_sum(low_list)
  54. # array_sum(ex_list)
  55. # array_sum(weird_list_div_10)
  56. # array_sum(weird_list_mult_10)
  57. # array_sum(weird_list) # THIS DOESN'T WORK
Advertisement
Add Comment
Please, Sign In to add comment