QMB3302 Midterm A while loop is most closely related to which other type of function or statement. (choose the best answer) - Answer -for loop Assume you are starting from a completely blank workbook. What is missing from the code below in order to show this chart?Choose the best answer. The answer may not be "complete" in the sense that there could be more missing, but it is not provided as an a nswer choice. Put another way... only one of these answers progresses this visual along.X = range(1, 10)Y = [i * 2 for i in X]plt.plot(X, Y)plt.xlabel('some x')plt.ylabel('some y')plt.title('My Graph')plt.show() - Answer -Import matplotlib.pyplot as plt Assuming this is a complete code chunk, and we expect to see output printed after running this, why is the below code incorrect? (choose the best answer, it may not be a great answer!) if tom brady == the goat: [TAB] print("The Bucs just won another Super Bowl") - Answer -The variables are not defined Company is a list containing 4 strings, sales is a list with 4 integers. Which of these code snippets would create a bar chart? - Answer -import matplotlib.pyplot as plt plt.bar(company ,sales, color='grey') datasets to be joined generally need something in common, like a customer ID. the relationship doesnt need to be 1 to 1 - Answer -True First create a simple dataframe using the below code. import pandas as pd # create a list of listsdata = [['A1', 2, 4, 8], ['A2', 3, 7, 17], ['A3', 1, None, 7], ['A4', 989, 186, 3698], ['A5', 0, 0 ,None]] # Create the pandas DataFrame df= pd.DataFrame(data, columns=['ID', 'Value 1', 'Value 2','Value 3']) df Questions:If you ran:df = df.dropna() df How many rows would remain in the dataframe? - Answer -3 For pandas to work, data must be formatted as lists before it is imported True or False? - Answer -False Heatmaps can be used to quickly understand correlated variables in a dataset - Answer -True Identify the parts of a for loop below: for _________ in _________ : ____________ - Answer -iteration variables iteration Statement imagine we create a pandas series using the below code. what is one simple way to retrieve the value 0.5 from the series?import pandas as pd df = pd.Series([0.75, 0.25, 0.50, 1.0], index=['a', 'b', 'c', 'd']) df - Answer -df['c'] Imagine we have a data frame, df. What would be the purpose for running code like the below? (why would we run it?) df.loc[1] - Answer -To look for, retrieve a value from df Imagine we have a pandas dataframe we have named 'df'.The dataframe consists of 2 columns."col1" is 30 values long and is a random mix of the letters 'a' 'b' and 'c'"num1" is also 30 values long, and is a random set of numerical data (all integers)Which of the following would give you the mean of the numerical (num1) column, grouped by the values from column "col1"? - Answer -
df.groupby('col1').mean()