Category

Data Analysis

Category

import pandas as pd from pandas import Series, DataFrame import numpy as np In [2]: import matplotlib.pyplot as plt import seaborn as sns sns.set_style(‘whitegrid’) %matplotlib inline In [3]: from __future__ import division In [4]: import requests In [5]: from io import StringIO In [6]: url = ‘https://elections.huffingtonpost.com/pollster/2012-general-election-romney-vs-obama.csv’ source = requests.get(url).text poll_data = StringIO(source) In [7]: poll_df = pd.read_csv(poll_data) In [8]: poll_df.info() <class ‘pandas.core.frame.DataFrame’> RangeIndex: 586 entries, 0 to 585 Data columns (total 17 columns): Pollster 586 non-null object Start Date 586 non-null object End Date 586 non-null object Entry Date/Time (ET) 586 non-null object Number of Observations 564 non-null float64 Population 586 non-null object Mode 586 non-null…

Introduction The sinking of the RMS Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the Titanic sank after colliding with an iceberg, killing 1502 out of 2224 passengers and crew. This sensational tragedy shocked the international community and led to better safety regulations for ships. One of the reasons that the shipwreck led to such loss of life was that there were not enough lifeboats for the passengers and crew. Although there was some element of luck involved in surviving the sinking, some groups of people were more likely to…

In this portfolio project I will be looking at data from the stock market, particularly some technology stocks. I will use pandas to get stock information, visualize different aspects of it, and finally I will look at a few ways of analyzing the risk of a stock, based on its previous performance history. I will also be predicting future stock prices through a Monte Carlo method! I’ll be answering the following questions along the way: 1.) What was the change in price of the stock over time?2.) What was the daily return of the stock on average?3.) What was the…