1.Question 1How can you display the last 5 rows of the dataframe?1 pointdf.tail()df.lastk()df.end()2.Question 2What will this code generate?12345X = daily_return_df['FB']Y = daily_return_df['TWTR']plt.figure(figsize = (15, 10))plt.scatter(X, Y);plt.grid()1 pointScatterplot of Facebook returns on the X axis vs. Twitter returns on the Y axisScatterplot of Facebook returns on the Y axis vs. Twitter returns on the X axis 3.Question 3What does explode attribute do in the code below?12345678910values = [20, 55, 5, 17, 3]colors = ['g', 'r', 'y', 'b', 'm']explode = [0, 0, 0.1, 0, 0]labels = ['AAPL', 'GOOG', 'T', 'TSLA', 'AMZN'] # Use matplotlib to plot a pie chart plt.figure(figsize = (10, 10))plt.pie(values, colors = colors, labels = labels, explode = explode)plt.title('STOCK PORTFOLIO')plt.show()1 pointSeparate the AT&T Slice from the Pie ChartSeparate Google Slice from the Pie ChartSeparate Tesla Slice from the Pie Chart4.Question 4What does this code generate?12sigma = daily_return_df['FB'].std() 1 pointStandard deviation of Facebook daily returnsDispersion of Facebook daily returns away from the meanMean of Facebook daily returnsVariance of Facebook daily returns5.Question 5What will this code generate?1234stock_df.plot(x = 'Date', y = ['NFLX', 'FB', 'T'], figsize = (18, 10), linewidth = 3)plt.ylabel('Price')plt.title('Stock Prices')plt.grid()1 pointPlot 3 line plots of Netflix, Facebook, and AT&T stocks on one figurePlot 3 line subplots of Netflix, Facebook and AT&T6.Question 6What will this code generate?12345678910111213plt.figure(figsize = (20, 10)) plt.subplot(1, 3, 1)plt.plot(stock_df['NFLX'], 'r--');plt.grid() plt.subplot(1, 3, 2)plt.plot(stock_df['FB'], 'b.');plt.grid() plt.subplot(1, 3, 3)plt.plot(stock_df['T'], 'b.');plt.grid()1 pointPlot 3 line plots of Netflix, Facebook, and AT&T stocks on one figurePlot 3 line subplots of Netflix, Facebook and AT&T7.Question 7Does this code generate a 3D scatter plot?
Question
1.Question 1How can you display the last 5 rows of the dataframe?1 pointdf.tail()df.lastk()df.end()2.Question 2What will this code generate?12345X = daily_return_df['FB']Y = daily_return_df['TWTR']plt.figure(figsize = (15, 10))plt.scatter(X, Y);plt.grid()1 pointScatterplot of Facebook returns on the X axis vs. Twitter returns on the Y axisScatterplot of Facebook returns on the Y axis vs. Twitter returns on the X axis 3.Question 3What does explode attribute do in the code below?12345678910values = [20, 55, 5, 17, 3]colors = ['g', 'r', 'y', 'b', 'm']explode = [0, 0, 0.1, 0, 0]labels = ['AAPL', 'GOOG', 'T', 'TSLA', 'AMZN'] # Use matplotlib to plot a pie chart plt.figure(figsize = (10, 10))plt.pie(values, colors = colors, labels = labels, explode = explode)plt.title('STOCK PORTFOLIO')plt.show()1 pointSeparate the AT&T Slice from the Pie ChartSeparate Google Slice from the Pie ChartSeparate Tesla Slice from the Pie Chart4.Question 4What does this code generate?12sigma = daily_return_df['FB'].std() 1 pointStandard deviation of Facebook daily returnsDispersion of Facebook daily returns away from the meanMean of Facebook daily returnsVariance of Facebook daily returns5.Question 5What will this code generate?1234stock_df.plot(x = 'Date', y = ['NFLX', 'FB', 'T'], figsize = (18, 10), linewidth = 3)plt.ylabel('Price')plt.title('Stock Prices')plt.grid()1 pointPlot 3 line plots of Netflix, Facebook, and AT&T stocks on one figurePlot 3 line subplots of Netflix, Facebook and AT&T6.Question 6What will this code generate?12345678910111213plt.figure(figsize = (20, 10)) plt.subplot(1, 3, 1)plt.plot(stock_df['NFLX'], 'r--');plt.grid() plt.subplot(1, 3, 2)plt.plot(stock_df['FB'], 'b.');plt.grid() plt.subplot(1, 3, 3)plt.plot(stock_df['T'], 'b.');plt.grid()1 pointPlot 3 line plots of Netflix, Facebook, and AT&T stocks on one figurePlot 3 line subplots of Netflix, Facebook and AT&T7.Question 7Does this code generate a 3D scatter plot?
Solution
-
The correct answer is df.tail(). This function is used to get the last n rows. Here n is 5 by default.
-
The correct answer is Scatterplot of Facebook returns on the X axis vs. Twitter returns on the Y axis. The scatter plot is used to find the correlation between two variables. Here the correlation is between Facebook and Twitter returns.
-
The correct answer is Separate the AT&T Slice from the Pie Chart. The explode attribute is used to specify the fraction of the radius with which to offset each wedge.
-
The correct answer is Standard deviation of Facebook daily returns. The std() function is used to find the standard deviation which measures the amount of variation or dispersion of a set of values.
-
The correct answer is Plot 3 line plots of Netflix, Facebook, and AT&T stocks on one figure. The plot() function is used to draw a line from one point to another point.
-
The correct answer is Plot 3 line subplots of Netflix, Facebook and AT&T. The subplot() function is used to add a subplot to the current figure.
-
Without the code, it's impossible to determine whether it generates a 3D scatter plot or not. Please provide the code.
Similar Questions
4.Question 4What does this code generate?12sigma = daily_return_df['FB'].std() 1 pointStandard deviation of Facebook daily returnsDispersion of Facebook daily returns away from the meanMean of Facebook daily returnsVariance of Facebook daily returns5.Question 5What will this code generate?
How can you display the first five rows in the pandas DataFrame “df”? (You can select more than one option.)A.df.top()B.df.head()C.df.head(5)D.df.tail()
Assume that we have an employee_df DataFrame that contains 10 rows. What will the following code do? (You can select more than one option.)employee_df.iloc[8:]A.Show the last two rows in the DataFrameB.Show all elements starting from index 8 onwardsC.Show the last row in the DataFrameD.Show the last three rows in the DataFrame
Which of the following functions prints out the first five rows of a pandas DataFrame? Group of answer choices list_firstfive() print_head() head() first()
By default .head() function displaylast 5 rows and 5 columnsfirst 5 rows and all columnslast 5 rows and all columnsfirst 5 rows and 5 columns
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.