The present value (PV) of a stock with zero growth is derived by dividing dividends distributed per period by the required return in that certain period. The formula is not an exact or guaranteed approach for evaluating a stock’s value but is more of a theoretical approach.The PV of a stock is specific to stocks that have zero or no growth. It is important to note that the period used for dividends and that for the required return must match. For example, for annual dividends, yearly return must be used.As stated above, the PV formula is more of a theoretical ... Read More
An investment’s “expected return” is the total money one can expect to lose or gain on an investment with a foreseeable rate of return. Basically, it lets one know whether the investment would be profitable providing enough money or it will be a loss, costing the investors’ money. By extension, it also tells one what kind of return you can expect when from a portfolio with a particular mix of investments.Understanding the Limits of Expected ReturnThe expected rate of return is more of a closer guess than a firm prediction. Regardless of whether you calculate the expected return of an ... Read More
Ordinary shares, also known as common shares, are used to raise capital for businesses. They are equity stocks that provide voting rights to the shareholders. Usually, dividends on ordinary shares are distributed according to the discretion of the management of the company that issues these shares. The dividends are distributed according to availability of profits. Common shares represent the ownership of shareholders in the company.ExplanationCommon shares provide the ownership rights to shareholders as per their number of shares the shareholders have. These shareholders have the right to voting and they are offered some privileges as an owner of a company. ... Read More
Not Cash EarningsThe biggest and, by far, the most prominent disadvantage of the P/E ratio is that the earnings it shows are the accounting earnings. These earnings are defined by the accounting standards of specific standards for a particular country. The earnings are not the cash earnings of the firm. In fact, many companies in the stock exchange report profits but gain no cash actually.Not Easy to Estimate the Value of a CompanyAnother problem with the P/E assumption is that the earnings stay the same for a considerable time in the future. So, if a company is trading at 10 ... Read More
Standard Deviation (SD) is a technique of statistics that represents the risk or volatility in investment. It gives a fair picture of the fund's return. It tells how much data can deviate from the historical mean return of the investment.The higher the Standard Deviation, the higher will be the ups and downs in the returns. For example, for a fund with a 15 percent average rate of return and an SD of 5 percent, the return will deviate in the range from 10-20 percent.Note − In SD, the ends of volatility are determined by adding and subtracting the average return ... Read More
To find rolling mean, we will use the apply() function in Pandas. At first, let us import the required library −import pandas as pdCreate a DataFrame with 2 columns. One is an int column −dataFrame = pd.DataFrame( { "Car": ['Tesla', 'Mercedes', 'Tesla', 'Mustang', 'Mercedes', 'Mustang'], "Reg_Price": [5000, 1500, 6500, 8000, 9000, 6000] } )Group using GroupBy and find the Rolling Mean using apply() −dataFrame.groupby("Car")["Reg_Price"].apply( lambda x: x.rolling(center=False, window=2).mean()) ExampleFollowing is the code −import pandas as pd # Create DataFrame dataFrame = pd.DataFrame( { ... Read More
To delete a column from a DataFrame, use del(). You can also use pop() method to delete. Just drop it using square brackets. Mention the column to be deleted in the brackets and that’s it, for example −del dataFrame[‘ColumnName’]Import the required library with an alias −import pandas as pdCreate a Pandas DataFrame −dataFrame = pd.DataFrame( { "Car": ['BMW', 'Lexus', 'Audi', 'Mustang', 'Bentley', 'Jaguar'], "Units": [100, 150, 110, 80, 110, 90] } ) Now, delete a column “Car” from a DataFrame −del ... Read More
When it is required to sort strings based on case difference, a method is defined that takes a string as a parameter. This method uses list comprehension and ‘isupper’ and ‘islower’ methods along with list comprehension to get case difference. Their difference gives the sorted values.ExampleBelow is a demonstration of the samedef get_diff(my_string): lower_count = len([ele for ele in my_string if ele.islower()]) upper_count = len([ele for ele in my_string if ele.isupper()]) return abs(lower_count - upper_count) my_list = ["Abc", "Python", "best", "hello", "coders"] print("The list is :") print(my_list) my_list.sort(key=get_diff) print("Sorted Strings by case ... Read More
When it is required to filter similar case strings, list comprehension can be used along with ‘isupper’ and ‘islower’ methods.ExampleBelow is a demonstration of the samemy_list = ["Python", "good", "FOr", "few", "CODERS"] print("The list is :") print(my_list) my_result = [sub for sub in my_list if sub.islower() or sub.isupper()] print("The strings with same case are :") print(my_result)OutputThe list is : ['Python', 'good', 'FOr', 'few', 'CODERS'] The strings with same case are : ['good', 'few', 'CODERS']ExplanationA list is defined and is displayed on the console.The list comprehension is used to iterate over the list and check if the strings ... Read More
When it is required to find the index value that has been repeated in a list, it is iterated over using the list comprehension and ‘enumerate’.ExampleBelow is a demonstration of the samemy_list = [4, 0, 3, 1] print("The list is :") print(my_list) my_result = [element for sub in ([index] * element for index, element in enumerate(my_list)) for element in sub] print("The result is :") print(my_result)OutputThe list is : [4, 0, 3, 1] The result is : [0, 0, 0, 0, 2, 2, 2, 3]ExplanationA list is defined and is displayed on the console.List comprehension is used to ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP