Description

Please submit the Jupyter Notebook and a pdf of thenotebook. Use mongoDB queries for the following tasks:

1. Import the compustat csv file into a collection.

2. Get the total number of documents inside thecollection.

3. Get the total number of distinct value in field”fqtr”. Please note that the distinct() function returns an arrayinstead of documents.

4. Return fields (datadate, tic, atq, ltq) from documents whichhave atq larger than 10,000. Please limit the output records to 5.

5. Calculate the average atq for each ticker when the fyearq islarger than 2015. Please limit the output records to 10.

6. Save all output records from question 5 into a newcollection.

7. Export the collection from question 6 to a csv file.