Posts

Showing posts from May, 2021

ASSIGNMENT - 4, GO_STP_8113

  GO_STP_8113 Assignment - 4 Goeduhub Technologies Task link : https://www.goeduhub.com/11546/question-exercise-practice-solutions-science-machine-learning #OnlineSummerTraining   #machinelearning   #datascience   #PYTHONNUMPY   #pandas   #pythonprogramming   #goeduhub SOLUTIONS: Import the numpy package under the name np and Print the numpy version and the configuration  import numpy as np print(np.__version__) np.show_config() 2. Create a null vector of size 10 import numpy as np print(np.zeros(10)) 3. Create Simple 1-D array and check type and check data types in array import numpy as np a = np.arange(0, 10) print(type(a)) print(a.dtype) 4. How to find number of dimensions, bytes per element and bytes of memory used? import numpy as np a = np.arange(0, 10) print(a.ndim) print(a.itemsize) print(a.nbytes) 5. Create a null vector of size 10 but the fifth value which is 1 import numpy as np a = np.zeros(10) a[4]=1 print(a) 6. Create a vector w...

ASSIGNMENT - 3, GO_STP_8113

 GO_STP_8113 ASSIGNMENT - 3 Goeduhub Technologies Task link : https://www.goeduhub.com/11531/dictionary-question-exercise-practice-solutions-learning  #OnlineSummerTraining   #machinelearning   #datascience   #PYTHONNUMPY   #pandas   #pythonprogramming   #goeduhub SOLUTIONS: Q.1 Write a Python Program to sort (ascending and descending) a dictionary by value. import operator x = {'A':51,'B':5,'C':7,'D':89,'E':2} ascd = sorted(x.items(), key=operator.itemgetter(1)) print('Ascending Order is : ',ascd) desc = sorted(x.items(), key=operator.itemgetter(1), reverse=True) print('Descending Order is : ',desc) Q.2 Write a Python Program to add a key to a dictionary.  a = {'A':7,'B':84,'C':9,'D':5} a.update({'E':8}) print(a) 3 Write a  program asks for City name and Temperature and builds a dictionary using that Later on you can input City name and it will tell you the Temperature of that City. dic=dic...

ASSIGNMENT - 2 , GO_STP_8113

GO_STP_8113 ASSIGNMENT -2 https://www.goeduhub.com/11513/question-exercise-practice-solutions-science-machine-learning #OnlineSummerTraining   #machinelearning   #datascience   #PYTHONNUMPY   #pandas   #pythonprogramming   #goeduhub Is a list mutable?            Yes list is mutable. Does a list need to be homogeneous?           List is both homogeneous and heterogeneous. What is the difference between a list and a tuple.           List is mutable and tuple is immutable. How to find the number of elements in the list?           len() function is used to  find the number of elements in the list. How to check whether the list is empty or not?           if len(list)=0 is used to check whether a list is empty or not. How to find the first and last element of the list?           First element list[0], Last...