HackerRank-Python(90)
-
Prepare > Python > Numpy > Mean, Var, and Std
Mean, Var, and Std | HackerRank Use the mean, var and std tools in NumPy on the given 2-D array. www.hackerrank.com 문제 Task You are given a 2-D array of size X. Your task is to find: The mean along axis 1 The var along axis 0 The std along axis None Input Format The first line contains the space separated values of N and M. The next N lines contains M space separated integers. Output Format Firs..
2023.09.05 -
Prepare > Python > Numpy > Min and Max
Min and Max | HackerRank Use the min and max tools of NumPy on the given 2-D array. www.hackerrank.com 문제 Task You are given a 2-D array with dimensions N X M. Your task is to perform the min function over axis 1 and then find the max of that. Input Format The first line of input contains the space separated values of N and M. The next N lines contains M space separated integers. Output Format C..
2023.09.04 -
Prepare > Python > Numpy > Sum and Prod
Sum and Prod | HackerRank Perform the sum and prod functions of NumPy on the given 2-D array. www.hackerrank.com 문제 Task You are given a 2-D array with dimensions N X M. Your task is to perform the sum tool over axis 0 and then find the product of that result. Input Format The first line of input contains space separated values of N and M. The next N lines contains M space separated integers. Ou..
2023.09.03 -
Prepare > Python > Numpy > Floor, Ceil and Rint
Floor, Ceil and Rint | HackerRank Use the floor, ceil and rint tools of NumPy on the given array. www.hackerrank.com 문제 Task You are given a 1-D array, A. Your task is to print the floor, ceil and rint of all the elements of A. Note In order to get the correct output format, add the line np.set_printoptions(legacy='1.13') below the numpy import. Input Format A single line of input containing the..
2023.09.02 -
Prepare > Python > Numpy > Array Mathematics
Array Mathematics | HackerRank Perform basic mathematical operations on arrays in NumPy. www.hackerrank.com 문제 Task You are given two integer arrays, A and B of dimensions N X.M Your task is to perform the following operations: Add (A + B) Subtract (A - B) Multiply (A * B) Integer Division (A / B) Mod (A % B) Power (A ** B) Note There is a method numpy.floor_divide() that works like numpy.divide..
2023.09.01 -
Prepare > Python > Numpy > Eye and Identity
Eye and Identity | HackerRank Create an array using the identity or eye tools from the NumPy module. www.hackerrank.com 문제 Task Your task is to print an array of size N X M with its main diagonal elements as 1's and 0's everywhere else. Input Format A single line containing the space separated values of N and M. N denotes the rows. M denotes the columns. Output Format Print the desired N X M arr..
2023.08.31 -
Prepare > Python > Numpy > Zeros and Ones
Zeros and Ones | HackerRank Print an array using the zeros and ones tools in the NumPy module. www.hackerrank.com 문제 Task You are given the shape of the array in the form of space-separated integers, each integer representing the size of different dimensions, your task is to print an array of the given shape and integer type using the tools numpy.zeros and numpy.ones. Input Format A single line ..
2023.08.30