Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Create two numpy arrays and add the elements of both the arrays and store the result in sumArray.


Part 1

Write a Python program that does the following. 

  • Create a string that is a long series of words separated by spaces. The string is your own creative choice. It can be names, favorite foods, animals, anything. Just make it up yourself. Do not copy the string from another source. 
  • Turn the string into a list of words using split
  • Delete three words from the list, but delete each one using a different kind of Python operation. 
  • Sort the list. 
  • Add new words to the list (three or more) using three different kinds of Python operation. 
  • Turn the list of words back into a single string using join
  • Print the string. 

Part 2

Provide your own examples of the following using Python lists. Create your own examples. Do not copy them from another source. 

  • Nested lists 
  • The “*” operator 
  • List slices 
  • The “+=” operator 
  • A list filter 
  • A list operation that is legal but does the "wrong" thing, not what the programmer expects 

Provide the Python code and output for your program and all your examples.


Add methods to the classes and subclasses:


  • a Movie can calculate:
  • totalMinutes()
  • for example, a movie 1 hour and 40 minutes long = 100 minutes total
  • a Snack can calculate:
  • amtHarm()
  • = the #calories times the amount of sodium or sugar
  • an Employee can calculate:
  • employeeMonthlyPay()
  • assume Staff work 40hours/week and 4 weeks/month

In the main code:


  • make lists for movies, snacks, and employees
  • use loops to find:
  • the total length of all movies
  • the most dangerous snack
  • the poorest employee

1. In K-means algorithm, what is the most commonly used distance metric to calculate distance between centroid of each cluster and data points?

 

a)Chebyshev distance

b)Manhattan 

c)Euclidean

d)None of the above



1. Which of the following statement is not correct about k-means?

 


a)Accuracy of cluster are improved by scaling of attributes.

b)K-means clusters are affected by outliers.

c)K-Means clustering is NOT influenced by initial centroids which are called cluster seeds

d)Number of clusters to be built is typically an user input and it impacts the way clusters are created


1. The method / metric which is NOT useful to determine the optimal number of clusters in unsupervised clustering algorithms is

 a)Dendogram

 b)Elbow method

c) Scatter plot

d) None of the above



1. Each centroid in K- means algorithm defines one 

 

a.cluster

b.data point

c.two clusters

d.None of the above



1. Match the terms in Group A with the relevant terms in Group B

        Group A                     Group B

A.) k-means                  1) unsupervised learning algorithm

B) knn                       2) k is no. of clusters

c.) logistic regression          3) k is no. of neighbours

d). clustering                 4) logit function


Create a mini quiz game program that asks the user three (3) questions,the starting score is 10 points.if the answer is incorrect 1 point is deducted from the score


Write a Python program that will ask the user to input a string (containing exactly one word). Then your program should print subsequent substrings of the given string as shown in the examples below.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS