Solving 50 Python NumPy Problems - From Easy to Difficult

Solving 50 Python NumPy Problems - From Easy to Difficult

Keith Galli via YouTube Direct link

- 36. Extract the integer part of a random array of positive numbers using 4 different methods

37 of 52

37 of 52

- 36. Extract the integer part of a random array of positive numbers using 4 different methods

Class Central Classrooms beta

YouTube videos curated by Class Central.

Classroom Contents

Solving 50 Python NumPy Problems - From Easy to Difficult

Automatically move to the next video in the Classroom when playback concludes

  1. 1 - Video Overview & Code Setup
  2. 2 - 1. Import the numpy package under the name np
  3. 3 - 2. Print the numpy version and the configuration
  4. 4 - 3. Create a null vector of size 10
  5. 5 - 4. How to get the memory size of any array
  6. 6 - 5. How to get documentation of the numpy add function from the command line
  7. 7 - 6. Create a null vector of size 10 but the fifth value which is 1
  8. 8 - 7. Create a vector with values ranging from 10 to 49
  9. 9 - 8. Reverse a vector first number becomes last
  10. 10 - 9. Create a 3x3 Matrix with values ranging from 0 to 8
  11. 11 - 10. Find indices of non-zero elements from array
  12. 12 - 11. Create a 3x3 identity matrix
  13. 13 - 12. Create a 3x3x3 array with random values.
  14. 14 - 13. Create a 10x10 array with random values and find min/max values
  15. 15 - 14. Create a random vector of size 30 and find the mean value
  16. 16 - 15. Create a 2d array with 1 on the border and 0 inside
  17. 17 - 16. How to add a border filled with 0’s around an existing array? np.pad
  18. 18 - 17. Evaluate some np.nan expressions
  19. 19 - 18. Create a 5x5 matrix with values 1,2,3,4 just below the diagonal
  20. 20 - 19. Create an 8x8 matrix and fill it with a checkerboard pattern
  21. 21 - 20. Get the 100th element from a 6,7,8 shape array
  22. 22 - 21. Create a checkerboard pattern 8x8 matrix using np.tile function
  23. 23 - 22. Normalize a random 5x5 matrix
  24. 24 - 23. Create a custom dtype that describes a color as four unsigned bytes RGBA
  25. 25 - 24. Multiply a 5x3 matrix by a 3x2 matrix real matrix product
  26. 26 - 25. Given a 1D array, negate all elements which are between 3 and 8, in place
  27. 27 - 26. Default “range” function vs numpy “range” function
  28. 28 - 27. Evaluate whether expressions are legal or not
  29. 29 - 28. Evaluate divide by zero expressions / np.nan type casting
  30. 30 - 29. How to round away from zero a float array?
  31. 31 - 30. How to find common values between two arrays?
  32. 32 - 31. How to ignore all numpy warnings?
  33. 33 - 32. Is np.sqrt-1 == np.emath.sqrt-1 ??
  34. 34 - 33. Get the dates of yesterday, today, and tomorrow with numpy
  35. 35 - 34. How to get all the dates corresponding to the month of July 2016?
  36. 36 - 35. How to compute A+B*-A/2 in place without copy?
  37. 37 - 36. Extract the integer part of a random array of positive numbers using 4 different methods
  38. 38 - 37. Create a 5x5 matrix with row values ranging from 0 to 4
  39. 39 - 38. Use generator function that generates 10 integers and use it to build an array
  40. 40 - 39. Create a vector of size 10 with values ranging from 0 to 1, both excluded.
  41. 41 - 40. Create a random vector of size 10 and sort it.
  42. 42 - 41. How to sum a small array faster than np.sum?
  43. 43 - 42. Check if two random arrays A & B are equal
  44. 44 - 43. Make an array immutable read-only
  45. 45 - Puppies are great
  46. 46 - 44. Convert cartesian coordinates to polar coordinates
  47. 47 - 45. Create a random vector of size 10 and replace the maximum value by 0
  48. 48 - 46. Create a structured array with x and y coordinates covering the [0,1]x[0,1] area
  49. 49 - 47. Given two arrays, X and Y, construct the Cauchy matrix C Cij = 1/xi-yj
  50. 50 - 48. Print the min/max values for each numpy scalar type
  51. 51 - 49. How to print all the values of an array?
  52. 52 - 50. How to find the closest value to a given scalar in a vector?

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.