top of page
Mirza Yaqub

Analyzing Returns of Different Investments! (Python, Pandas)




Introduction


In this project, I will be using pandas to analyze and compare the profitability and risk of different investments. I will be using stock data for Facebook and Amazon for the year 2016 and I will be also using the stock data for the S&P 500.



Importing Modules and Data



  • I imported all of the modules required for visualizations and data manipulation.

  • When I read the CSV files, I wanted the date columns to be datetime64 and the index is set as the date for accurate analysis.

  • I also dropped any missing values from the dataset.


Glancing Over The Data


  • As we can see, there are 252 observations and 2 columns.

  • Most of the datatypes are floats.


Visualizing Daily Prices For Amazon/Facebook Stock and S&P 500

  • We can see that Amazon's stock reached a maximum price of $844 while Facebook's stock reached a maximum of only $133.





Visualizing Daily Stock Returns For Facebook and Amazon/S&P 500


  • Amazon's max stock return has been 9.5% while Facebook's has been 15%.

  • The S&P 500's max stock return has been 2.5%.








Yorumlar


bottom of page