100% found this document useful (1 vote)
455 views5 pages

Quiz 1 of Python and Statistics For Financial Analysis

The document contains a 10 question quiz on Python and statistics for financial analysis. The quiz covers topics like Pandas library, importing libraries and CSV files, slicing DataFrames, plotting charts, and moving averages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
455 views5 pages

Quiz 1 of Python and Statistics For Financial Analysis

The document contains a 10 question quiz on Python and statistics for financial analysis. The quiz covers topics like Pandas library, importing libraries and CSV files, slicing DataFrames, plotting charts, and moving averages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

29/12/22, 22:54 Quiz 1 of Python and Statistics for Financial Analysis

Digital Marketing Consultant

PYTHON AND STATISTICS FOR FINANCIAL ANALYSIS

Quiz 1 of Python and Statistics for Financial Analysis


By Admin September 4, 2021

Quiz 1 of Python and Statistics for Financial Analysis

1.
Question 1
Which of the following library has DataFrame object?

1 point
Matplotlib
Numpy
Statsmodels
Pandas
————————————————————————————————–
2.
Question 2
Which of the following is the correct way to import a library, eg Pandas?
1 point
1 pandas import

1 pandas
1 import pandas as pd

1 #include <pandas>

————————————————————————————————–

https://jamdbokhtier.com/quiz-1-of-python-and-statistics-for-financial-analysis/ 1/5
29/12/22, 22:54 Quiz 1 of Python and Statistics for Financial Analysis

3.
Question 3
What is the method of DataFrame object to import a csv file?
1 point
csv()
read_csv()
import_csv()
from_csv()
————————————————————————————————–
4.
Question 4

Which of the following attributes of a DataFrame return a list of column names of this
DataFrame?
1 point
columns
shape
dtype
column
————————————————————————————————–
5.
Question 5
Which of the following can slice ‘Close’ from ‘2015-01-01’ to ‘2016-12-31’ from data,
which is a DataFrame object?

1 point
1 data.loc[‘2015-01-01’:’2016-12-31’, ‘Close’]

1 data.iloc[‘2015-01-01’:’2016-12-31’, ‘Close’]

————————————————————————————————–
6.
Question 6
What is the method of DataFrame to plot a line chart?
https://jamdbokhtier.com/quiz-1-of-python-and-statistics-for-financial-analysis/ 2/5
29/12/22, 22:54 Quiz 1 of Python and Statistics for Financial Analysis

1 point
axhline()
scatter()
plot()
plot_graph()
————————————————————————————————–
7.
Question 7
Suppose you have a DataFrame – data, which contains columns ‘Open’, ‘High’,
‘Low’, ‘Close’, ‘Adj Close’ and ‘Volume’.

What does data[[‘Open’, ‘Low’]] return?


1 point
The first row of data which contains only columns ‘Open’ and ‘High’
Columns ‘Open’ and ‘Low’
No results are shown
All columns of data except ‘Open’ and ‘High’
————————————————————————————————–
8.
Question 8
Suppose you have a DataFrame ms , which contains the daily data of ‘Open’, ‘High’,
‘Low’, ‘Close’, ‘Adj Close’ and ‘Volume’ of Microsoft’s stock.

Which of the following syntax calculates the Price difference, (ie ‘Close’ of tomorrow –
‘Close’ of today)?
1 point
1 ms[‘Close’].shift(-1) – ms[‘Close’]

1 ms[‘Close’].shift(1) – ms[‘Close’].shift(1)

1 ms[‘Close’].shift(1) – ms[‘Close’]

https://jamdbokhtier.com/quiz-1-of-python-and-statistics-for-financial-analysis/ 3/5
29/12/22, 22:54 Quiz 1 of Python and Statistics for Financial Analysis

1 ms[‘Close’].shift(-1) – ms[‘Close’].shift(-1)

————————————————————————————————–
9.
Question 9
Suppose you have a DataFrame – ms , which contains the daily data of ‘Open’,
‘High’, ‘Low’, ‘Close’, ‘Adj Close’ and ‘Volumn’ of Microsoft’s stock.

What is the method of DataFrame to calculate the 60 days moving average?


1 point
rolling().mean(60)
rolling(60).median()
rolling(60).mean()
moving_average(60)
————————————————————————————————–
10.
Question 10
Which of the following idea(s) is/are correct to the simple trading strategy that we
introduced in the lecture video?

1 point
Use longer moving average as slow signal and shorter moving average as fast
signal
We short one share of stocks if fast signal is larger than slow signal
If fast signal is larger than slow signal, this indicates an upward trend at the
current moment

PREVIOUS NEXT

To be eligible for discount customers must Quiz 2 of Python and Statistics for Financial
have paid before the Discount Due Date Analysis
and must have paid at least the full balance
owing less the discount amount, i.e.

https://jamdbokhtier.com/quiz-1-of-python-and-statistics-for-financial-analysis/ 4/5
29/12/22, 22:54 Quiz 1 of Python and Statistics for Financial Analysis

Similar Posts

Quiz 2 of Python and Statistics Quiz 4 of Python and Statistics


for Financial Analysis for Financial Analysis
By Admin September 4, 2021 By Admin September 4, 2021

Disclaimer Privacy & Policy Advertise With Us About Us

https://jamdbokhtier.com/quiz-1-of-python-and-statistics-for-financial-analysis/ 5/5

You might also like