Statement of Completion#a79b9c60
Fun and Puzzles
easy
[ASSESSMENT] Vidhi Testing Assessment
Resolution
Activities
Take a look at the raw data:¶
Company stock symbols
In [27]:
!head sp500-symbols.csv
Name,Symbol 3M Company,MMM A.O. Smith Corp,AOS Abbott Laboratories,ABT AbbVie Inc.,ABBV Accenture plc,ACN Activision Blizzard,ATVI Acuity Brands Inc,AYI Adobe Systems Inc,ADBE Advance Auto Parts,AAP
Market cap raw data:
In [16]:
!head sp500-marketcap.csv
Name,Market Cap 3M Company,138721055226 A.O. Smith Corp,10783419933 Abbott Laboratories,102121042306 AbbVie Inc.,181386347059 Accenture plc,98765855553 Activision Blizzard,52518668144 Acuity Brands Inc,6242377704 Adobe Systems Inc,94550214268 Advance Auto Parts,8123611867
In [1]:
import pandas as pd
In [21]:
market_cap = pd.read_csv("sp500-marketcap.csv", index_col="Symbol")['Market Cap']
market_cap.head()
Out[21]:
Symbol MMM 138721055226 AOS 10783419933 ABT 102121042306 ABBV 181386347059 ACN 98765855553 Name: Market Cap, dtype: int64
In [24]:
symbols = pd.read_csv("sp500-symbols.csv", index_col="Name")['Symbol']
symbols.head()
Out[24]:
Name 3M Company MMM A.O. Smith Corp AOS Abbott Laboratories ABT AbbVie Inc. ABBV Accenture plc ACN Name: Symbol, dtype: object
Basic Series Attributes¶
1. Name of the market_cap
Series¶
In [ ]:
2. Name of the symbols
Series¶
In [ ]:
3. What's the dtype of market_cap
¶
In [ ]:
4. What's the dtype of symbols
¶
In [ ]:
5. How many elements do the series have?¶
In [ ]:
6. What's the minimum value for Market Cap?¶
In [ ]:
7. What's the maximum value for Market Cap?¶
In [ ]:
8. What's the average Market Cap?¶
In [ ]:
9. What's the median Market Cap?¶
In [ ]:
Selection and Indexing¶
In [50]:
market_cap.head()
Out[50]:
Symbol MMM 138721055226 AOS 10783419933 ABT 102121042306 ABBV 181386347059 ACN 98765855553 Name: Market Cap, dtype: int64
10. What's the symbol of Oracle Corp.
?¶
In [ ]:
11. What's the Market Cap of Oracle Corp.
?¶
In [ ]:
12. What's the Market Cap of Wal-Mart Stores
?¶
In [ ]:
13. What's the symbol of the 129th company?¶
In [ ]:
14. What's the Market Cap of the 88th company in symbols
?¶
In [ ]:
15. Create a new series only with FAANG Stocks¶
In [ ]:
faang_market_cap = ...
In [ ]:
16. Select the market cap of companies in position 1st, 100th, 200th, etc.¶
In [ ]:
Sorting Series¶
17. What's the 4th company sorted lexicographically by their symbol?¶
In [ ]:
18. What's the Market Cap of the 7th company (in descending order)?¶
In [ ]: