1614843363
In Portfolio (or mean-variance) theory, the efficient frontier is a set of points (or portfolios) in which no other point achieves higher return given a certain risk. It is a spectrum that is closely related to the Markowitz Portfolio Optimization problem. In this lecture, and in an attempt of achieving the optimal portfolio in two different ways, we show how to plot the efficient frontier on a scatter plot containing different portfolios. This lecture is outlined as follows:
⏲Outline⏲
00:00 Highlights
00:23 Introduction
01:41 Setting Jupyter Lab
02:11 Pandas Datareader
04:42 Reading Stocks
06:04 Dataframe Concatenation
07:25 Returns
08:15 Log Returns
09:18 Sharpe Ratio
11:49 Log Asset Returns
12:14 Volatility Per Portfolio
13:02 Return vs Volatility Scatter Plot
18:34 Sharpe Ratio Maximization (1st way)
19:28 Scatter Plot: Returns vs Volatility
22:01 Optimal Weights by Markowitz Portfolio Optimization (2nd way)
28:00 Efficient Markowitz Frontier
32:30 Important Message
33:36 Outro
Instructor: Dr. Ahmad Bazzi
🏗️Material
Browser: https://www.google.com/chrome/
Jupyter: https://jupyter.org/
Google: https://www.google.com/
Pandas: https://pandas.pydata.org/
DataReaders: https://pandas-datareader.readthedocs…
MATPLOTLIB: https://matplotlib.org/
datetime: https://docs.python.org/3/library/dat…
SciPy: https://www.scipy.org/
NumPy: https://numpy.or/gj
Subscribe: https://www.youtube.com/channel/UCgC1d4JZ1Fz4t8MWLJD464w
#python
1615441553
This service is very affordable and is designed to help students prepare and complete the final project according to their standards paraphrase for me. The service is also designed so that the student gets the most out of the academic writing service that the essay service offers.
1615762093
When I was just beginning to understand the topic of gambling, I twice encountered fraudsters. It is good that at that time I did not play for small amounts and did not suffer financially. Then I understood this system and began to select very carefully the institution for gambling. Now I spend my time only here - vulcan vegas casino free slots, everything works smoothly and a large selection of games. I love to spend time on this site
1619518440
Welcome to my Blog , In this article, you are going to learn the top 10 python tips and tricks.
…
#python #python hacks tricks #python learning tips #python programming tricks #python tips #python tips and tricks #python tips and tricks advanced #python tips and tricks for beginners #python tips tricks and techniques #python tutorial #tips and tricks in python #tips to learn python #top 30 python tips and tricks for beginners
1619510796
Welcome to my Blog, In this article, we will learn python lambda function, Map function, and filter function.
Lambda function in python: Lambda is a one line anonymous function and lambda takes any number of arguments but can only have one expression and python lambda syntax is
Syntax: x = lambda arguments : expression
Now i will show you some python lambda function examples:
#python #anonymous function python #filter function in python #lambda #lambda python 3 #map python #python filter #python filter lambda #python lambda #python lambda examples #python map
1590469702
Mobiweb Technologies is considered as an expert stock market betting software development company that offers an extensive and wide coverage betting software to empower the bettors. Our Team of top level management and expert sports betting software developers design unbeatable software development strategies that compete with other betting software in the market. People who believe in investment consider gambling as a source of profit generation and for this, Mobiweb’s betting software offers one touch betting facility to place the wager. Most importantly, it offers best-in-class user experience and provides a user engaging atmosphere. If you are looking for developing stock market betting software then you don’t need to hesitate, give this opportunity to Mobiweb and get on time delivery of your project under minimum possible cost.
#stock market betting software development #stock market betting software #stock market betting app development #stock market betting app developers #stock market betting software providers
1596376860
Many investors consider fundamental analysis as their secret weapon to beat the stock market. You can perform it using many methods, but one thing they have in common. They all need data about companies’ financial statements.
Luckily all stocks traded on US stock markets must quarterly report to the Securities and Exchange Commission (SEC). Every quarter SEC prepares a comfortable CSV package to help all the investors in their quest for the investment opportunity. Let’s explore how to get valuable insights from these .csv files.
In this tutorial, we will use python’s pandas library which ideal for parsing CSV files, and we will learn how to:
We will process the data and:
As usual, you can follow the code in the notebook shared on GitHub.
There doesn’t seem to be any problem. You simply download the quarterly package from the SEC dataset page, you sort the values from the financial statements in descending order and pick the stocks on the top. The reality isn’t that straightforward. Let’s have a look and explore 45.55MB big zip file with all SEC filings for the first quarter of 2020.
The package for every quarter contains 5 files. Here’s an example of 2020 Q1:
Unzipped files in the SEC quarterly data dump
This article will only deal with the submission master because it contains more than enough information for one article. Follow-up story will examine the data in more detail. Let’s begin.
In the first quarter of 2020, the companies have submitted 13560
files and the sub.txt gathers 36 columns about them.
# load the .csv file into pandas
sub = pd.read_csv(os.path.join(folder,"sub.txt"), sep="\t", dtype={"cik":str})
# explore number of rows and columns
sub.shape
[Out]: (13560, 36)
I always start with a simple function that reviews each column of the data frame, checks the percentage of empty values, and how many unique values appear in the columns.
Explore the sub.txt file to see what data each column contain
Let me highlight a few important columns in the SEC submission master.
Example of the quick file overview in pandas
Based on the analysis, we see that the 2020Q1 submission contains 23 unique types of financial reports. Investors’ primary interest lies in the 10-K report, which covers the annual performance of the publically traded company. Because this report is expectedly delivered only once a year, important is also 10-Q report showing quarterly changes in the company’s financials.
10-K
Annual report of US-based company10-Q
Quarterly report and maybe20-F
Annual Reports of a foreign company40-F
Annual Reports of a foreign company (Canadian)Let’s see which forms are the most common in the dataset. Plotting of the form types in the 2020Q1 will show this picture:
Using Plotly’s low level API to produce bar and pie subplots
Different submission types reported by the companies in 2020Q1 using visualization in Plotly
The dataset contains over 7000 8-K reports notifying about important events like agreements, layoffs, usage of material, modification of shareholder rights, change in the senior positions, and more (see SEC’s guideline). Since they are the most common we should spend some time exploring them.
#stocks #exploratory-data-analysis #python #data-analysis #stock-market #data analysis
1623488340
Pandas is one of the predominant data analysis tools which is highly appreciated among data scientists. It provides numerous flexible and versatile functions to perform efficient data analysis.
In this article, we will go over 3 pandas tricks that I think will make you a more happy pandas user. It is better to explain these tricks with some examples. Thus, we start by creating a data frame to wok on.
The data frame contains daily sales quantities of 3 different stores. We first create a period of 10 days using the date_range
function of pandas.
import numpy as np
import pandas as pd
days = pd.date_range("2020-01-01", periods=10, freq="D")
The days variable will be used as a column. We also need a sales quantity column which can be generated by the randint
function of numpy. Then, we create a data frame with 3 columns for each store.
#machine-learning #data-science #python #python pandas tricks #efficient data analysis #python pandas tricks for efficient data analysis