Eco Outlook Axis
Eco Outlook Axis
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import ticker
import numpy_financial as npf
import yfinance as yf
import warnings
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from datetime import datetime
In [4]: HDFCBANK.tail()
Out[4]:
In [5]: x = HDFCBANK.index
In [6]: y = HDFCBANK.Close
In [7]: #Plot class will plot graph through taking two argument x and y
#These instance variables represent the data that will be plotted on the line plot.
class Plot:
def __init__(self,x,y):
self.x = x
self.y = y
def line_plot(self, x,y):
from matplotlib.ticker import FuncFormatter
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.plot(x,y, color="royalblue", alpha=0.9)
plt.gca().yaxis.set_major_formatter(FuncFormatter(lambda x, _: '{:.0f}'.format(x)))
ax.grid(color='white', alpha=0.20)
plt.show()
def bar_plot(self, x,y):
from matplotlib.ticker import FuncFormatter
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar(x,y, color="royalblue", alpha=0.9)
plt.gca().yaxis.set_major_formatter(FuncFormatter(lambda x, _: '{:.0f}'.format(x)))
ax.grid(color='white', alpha=0.20)
plt.show()
Out[16]: ▾ LinearRegression
LinearRegression()
In [19]: model.intercept_
Out[19]: -267862.43904379325
In [20]: model.coef_
Out[20]: array([0.36482439])
In [21]: plt.style.use('dark_background')
plt.figure(figsize=(30,15))
sns.scatterplot(x=X_test, y=y_test, label='Actual', color='blue')
plt.plot(X_test, y_pred, label='Predicted', color='red')
plt.title('Linear Regression Model - 3 year chart', fontsize=30, color="White", fontweight='bold')
plt.xlabel("YEAR", fontsize=20, fontweight='bold')
plt.ylabel("HDFCBANK (₹)", fontsize=20, fontweight='bold')
plt.tick_params(axis="both", labelsize=16)
plt.grid(linestyle='--', color='gray', alpha=0.7)
plt.show()
In [24]: hdfcbank_income_statement
Out[24]:
In [26]: year = []
revenue = []
for k, v in data.items():
if k != 'breakdown': # skip the header
year.append(int(k))
revenue.append(int(v))
year = pd.DataFrame(year)
revenue = pd.DataFrame(revenue)
In [27]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar(year[0],revenue[0], color="royalblue")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Total Revenue by Year")
plt.xlabel("Year")
plt.ylabel("Revenue (₹)")
ax.grid(color='white', alpha=0.20)
plt.show()
In [28]: data = hdfcbank_income_statement.loc[4]
data = data.head(10)
data
In [29]: year = []
revenue = []
for k, v in data.items():
if k != 'breakdown': # skip the header
year.append(int(k))
revenue.append(int(v))
year = pd.DataFrame(year)
revenue = pd.DataFrame(revenue)
In [30]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar(year[0],revenue[0], color="royalblue")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFC Bank Tax Provision by Year")
plt.xlabel("Year")
plt.ylabel("Tax Provision (₹)")
for i in range(len(year)):
plt.text(year.iloc[i], revenue.iloc[i], str(revenue.iloc[i][0]), ha='center', va='bottom', fontsize=9)
plt.gca().spines['bottom'].set_linewidth(1.5)
plt.gca().spines['left'].set_linewidth(1.5)
ax.grid(color='white', alpha=0.20)
plt.show()
In [32]: year = []
revenue = []
for k, v in data.items():
if k != 'breakdown': # skip the header
year.append(int(k))
revenue.append(int(v))
year = pd.DataFrame(year)
revenue = pd.DataFrame(revenue)
In [33]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar(year[0],revenue[0], color="royalblue")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFC Bank INTEREST INCOME AFTER PROVISION FOR LOAN LOSS by Year")
plt.xlabel("Year")
plt.ylabel("Interest Income (₹)")
for i in range(len(year)):
plt.text(year.iloc[i], revenue.iloc[i], str(revenue.iloc[i][0]), ha='center', va='bottom', fontsize=9)
plt.gca().spines['bottom'].set_linewidth(1.5)
plt.gca().spines['left'].set_linewidth(1.5)
ax.grid(color='white', alpha=0.20)
plt.show()
In [35]: year = []
revenue = []
for k, v in data.items():
if k != 'breakdown': # skip the header
year.append(int(k))
revenue.append(int(v))
year = pd.DataFrame(year)
revenue = pd.DataFrame(revenue)
In [36]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar(year[0],revenue[0], color="royalblue")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFC BANK Reconciled Depreciation by Year")
plt.xlabel("Year")
plt.ylabel("Reconciled Depreciation (₹)")
ax.grid(color='white', alpha=0.20)
plt.show()
In [37]: data4 = hdfcbank_income_statement.loc[16]
data4
In [38]: year = []
revenue = []
for k, v in data.items():
if k != 'breakdown': # skip the header
year.append(int(k))
revenue.append(int(v))
year = pd.DataFrame(year)
revenue = pd.DataFrame(revenue)
In [39]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar(year[0],revenue[0], color="royalblue")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFC BANK Net Income from Continuing Operation Net Minority Interest by Year")
plt.xlabel("Year")
plt.ylabel("Net Income (₹)")
ax.grid(color='white', alpha=0.20)
plt.show()
In [42]: year = []
cash = []
for k, v in total_assets.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [43]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_total_assets.year, df_total_assets.cash, color="royalblue")
plt.plot( df_total_assets.year, df_total_assets.cash, color="red", linestyle="--")
plt.scatter( df_total_assets.year, df_total_assets.cash, color="red", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.title("TOTAL ASSETS BY YEAR")
plt.xlabel("Year")
plt.ylabel("Total Assets (₹)")
ax.grid(color='white', alpha=0.20)
plt.show()
In [44]: Total_Liabilities_Net_Minority_Interests = balance_sheet_annually.loc[1]
Total_Liabilities_Net_Minority_Interests
In [45]: year = []
cash = []
for k, v in Total_Liabilities_Net_Minority_Interests.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [46]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_Total_Liabilities_Net_Minority_Interests.year, df_Total_Liabilities_Net_Minority_Interests.cash, color=
plt.plot( df_Total_Liabilities_Net_Minority_Interests.year, df_Total_Liabilities_Net_Minority_Interests.cash, color
plt.scatter( df_Total_Liabilities_Net_Minority_Interests.year, df_Total_Liabilities_Net_Minority_Interests.cash, co
plt.ticklabel_format(axis='y', style='plain')
plt.title("Total Liabilities Net Minority Interest")
plt.xlabel("Year")
plt.ylabel("Rupees ₹")
ax.grid(color='white', alpha=0.20)
plt.show()
In [48]: year = []
cash = []
for k, v in Total_Equity_Gross_Minority_Interests.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [49]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_Total_Equity_Gross_Minority_Interests.year, df_Total_Equity_Gross_Minority_Interests.cash, color="royal
plt.plot( df_Total_Equity_Gross_Minority_Interests.year, df_Total_Equity_Gross_Minority_Interests.cash, color="red"
plt.scatter( df_Total_Equity_Gross_Minority_Interests.year, df_Total_Equity_Gross_Minority_Interests.cash, color="r
plt.ticklabel_format(axis='y', style='plain')
plt.title("Total Equity Gross Minority Interest BY YEAR")
plt.xlabel("Year")
plt.ylabel("Rupees ₹")
ax.grid(color='white', alpha=0.20)
plt.show()
In [51]: year = []
cash = []
for k, v in Total_Capitalization.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [52]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_Total_Capitalization.year, df_Total_Capitalization.cash, color="royalblue")
plt.plot( df_Total_Capitalization.year, df_Total_Capitalization.cash, color="red", linestyle="--")
plt.scatter( df_Total_Capitalization.year, df_Total_Capitalization.cash, color="red", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.title("Total Capitalization")
plt.xlabel("Year")
plt.ylabel("Rupees ₹")
ax.grid(color='white', alpha=0.20)
plt.show()
In [53]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
#Total Assets
plt.plot(df_total_assets.year,df_total_assets.cash, color="red")
plt.scatter(df_total_assets.year,df_total_assets.cash, color="red", label="TOTAL ASSETS")
# Total Liabilities
plt.plot(df_Total_Liabilities_Net_Minority_Interests.year,df_Total_Liabilities_Net_Minority_Interests.cash, color="
plt.scatter(df_Total_Liabilities_Net_Minority_Interests.year,df_Total_Liabilities_Net_Minority_Interests.cash, colo
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK")
plt.xlabel("Year")
plt.ylabel("Rupee (₹)")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [54]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
#Total liabilities
plt.fill_between(df_Total_Liabilities_Net_Minority_Interests.year, df_Total_Liabilities_Net_Minority_Interests.cash
#total assets
plt.fill_between(df_total_assets.year, df_total_assets.cash, color="green", alpha=0.5, label="Total assets")
plt.ticklabel_format(axis='y', style='plain')
plt.title("CREDIT SUISSE GROUP ASSETS v/s LIABILITES")
plt.xlabel("Year")
plt.ylabel("₹")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [56]: year = []
cash = []
for k, v in Common_Stock_Equity.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [57]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_Common_Stock_Equity.year, df_Common_Stock_Equity.cash, color="royalblue")
plt.plot( df_Common_Stock_Equity.year, df_Common_Stock_Equity.cash, color="red", linestyle="--")
plt.scatter( df_Common_Stock_Equity.year, df_Common_Stock_Equity.cash, color="red", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.title("Common Stock Equity")
plt.xlabel("Year")
plt.ylabel("Total")
ax.grid(color='white', alpha=0.20)
plt.show()
In [59]: year = []
cash = []
for k, v in Net_Tangible_Assets.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [60]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_Net_Tangible_Assets.year, df_Net_Tangible_Assets.cash, color="royalblue")
plt.plot( df_Net_Tangible_Assets.year, df_Net_Tangible_Assets.cash, color="red", linestyle="--")
plt.scatter( df_Net_Tangible_Assets.year, df_Net_Tangible_Assets.cash, color="red", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.title("Net Tangible Assets")
plt.xlabel("Year")
plt.ylabel("Total Assets (₹)")
ax.grid(color='white', alpha=0.20)
plt.show()
In [61]: Total_Debt = balance_sheet_annually.loc[9]
Net_Debt = balance_sheet_annually.loc[10]
print(Total_Debt)
print(Net_Debt)
In [62]: year = []
cash = []
for k, v in Total_Debt.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [63]: year = []
cash = []
for k, v in Net_Debt.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [65]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
#Total Assets
plt.plot(df_Total_Debt.year,df_Total_Debt.cash, color="red")
plt.scatter(df_Total_Debt.year,df_Total_Debt.cash, color="red", label="TOTAL DEBT")
# Total Liabilities
plt.plot(df_Net_Debt.year,df_Net_Debt.cash, color="blue")
plt.scatter(df_Net_Debt.year,df_Net_Debt.cash, color="blue", label="NET DEBT")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK")
plt.xlabel("Year")
plt.ylabel("Rupee")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [66]: ## pd.set_option('display.max_rows', 100)
cashflow_annually = pd.read_csv('HDFCBANK_CASHFLOW STATEMENT.csv')
cashflow_annually.columns.values[0] = "breakdown"
cashflow_annually
Out[66]:
In [68]: year = []
cash = []
for k, v in operating_cash_flow_income.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [69]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_operating_cash_flow_income.year,df_operating_cash_flow_income.cash, color="red")
plt.scatter(df_operating_cash_flow_income.year,df_operating_cash_flow_income.cash, color="white", label="Operating
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Operating Cash Flow")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_operating_cash_flow_income.year, df_operating_cash_flow_income.cash, color="darkgrey")
plt.plot( df_operating_cash_flow_income.year, df_operating_cash_flow_income.cash, color="red", linestyle="--")
plt.scatter( df_operating_cash_flow_income.year, df_operating_cash_flow_income.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [71]: year = []
cash = []
for k, v in investing_cashflow.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [72]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_investing_cashflow.year,df_investing_cashflow.cash, color="red")
plt.scatter(df_investing_cashflow.year,df_investing_cashflow.cash, color="white", label="Investing Cash Flow")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Investing Cash Flow by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_investing_cashflow.year, df_investing_cashflow.cash, color="darkgrey")
plt.plot( df_investing_cashflow.year, df_investing_cashflow.cash, color="red", linestyle="--")
plt.scatter( df_investing_cashflow.year, df_investing_cashflow.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [74]: year = []
cash = []
for k, v in financing_cashflow.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [75]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_financing_cashflow.year,df_financing_cashflow.cash, color="red")
plt.scatter(df_financing_cashflow.year,df_financing_cashflow.cash, color="white", label="FINANCING CASHFLOW")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Financing Cash Flow by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_financing_cashflow.year, df_financing_cashflow.cash, color="darkgrey")
plt.plot( df_financing_cashflow.year, df_financing_cashflow.cash, color="red", linestyle="--")
plt.scatter( df_financing_cashflow.year, df_financing_cashflow.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [76]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
#Total Assets
plt.plot(df_operating_cash_flow_income.year,df_operating_cash_flow_income.cash, color="red")
plt.scatter(df_operating_cash_flow_income.year,df_operating_cash_flow_income.cash, color="red", label="Operating Ca
# Total Liabilities
plt.plot(df_investing_cashflow.year,df_investing_cashflow.cash, color="blue")
plt.scatter(df_investing_cashflow.year,df_investing_cashflow.cash, color="blue", label="Investing Cashflow")
# Total Liabilities
plt.plot(df_financing_cashflow.year,df_financing_cashflow.cash, color="darkorange")
plt.scatter(df_financing_cashflow.year,df_financing_cashflow.cash, color="darkorange", label="Financing Cashflow")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK")
plt.xlabel("Year")
plt.ylabel("Rupee")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [78]: year = []
cash = []
for k, v in change_working_capital.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [79]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_change_working_capital.year,df_change_working_capital.cash, color="red")
plt.scatter(df_change_working_capital.year,df_change_working_capital.cash, color="white", label="Change in working
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Financing Cash Flow by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [80]: cash_dividends_paid = cashflow_annually.loc[54]
cash_dividends_paid
In [81]: year = []
cash = []
for k, v in cash_dividends_paid.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [82]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_cash_dividends_paid.year,df_cash_dividends_paid.cash, color="red")
plt.scatter(df_cash_dividends_paid.year,df_cash_dividends_paid.cash, color="white", label="Cash Dividends Paid")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Cash Dividends Paid by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [84]: year = []
cash = []
for k, v in changes_in_cash.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [85]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_changes_in_cash.year, df_changes_in_cash.cash, color="darkgrey")
plt.plot( df_changes_in_cash.year, df_changes_in_cash.cash, color="red", linestyle="--")
plt.scatter( df_changes_in_cash.year, df_changes_in_cash.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Changes In Cash by Year")
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [87]: year = []
cash = []
for k, v in cash_At_start_Of_Period.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [88]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_cash_At_start_Of_Period.year,df_cash_At_start_Of_Period.cash, color="red")
plt.scatter(df_cash_At_start_Of_Period.year,df_cash_At_start_Of_Period.cash, color="white", label="Beginning Cash P
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Beginning Cash Position by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_cash_At_start_Of_Period.year, df_cash_At_start_Of_Period.cash, color="darkgrey")
plt.plot( df_cash_At_start_Of_Period.year, df_cash_At_start_Of_Period.cash, color="red", linestyle="--")
plt.scatter( df_cash_At_start_Of_Period.year, df_cash_At_start_Of_Period.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [89]: cash_At_End_Of_Period = cashflow_annually.iloc[58]
cash_At_End_Of_Period
In [90]: year = []
cash = []
for k, v in cash_At_End_Of_Period.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [91]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_cash_At_End_Of_Period.year,df_cash_At_End_Of_Period.cash, color="red")
plt.scatter(df_cash_At_End_Of_Period.year,df_cash_At_End_Of_Period.cash, color="white", label="End Cash Position")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK End Cash Position by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_cash_At_End_Of_Period.year, df_cash_At_End_Of_Period.cash, color="darkgrey")
plt.plot( df_cash_At_End_Of_Period.year, df_cash_At_End_Of_Period.cash, color="red", linestyle="--")
plt.scatter( df_cash_At_End_Of_Period.year, df_cash_At_End_Of_Period.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [92]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
#Total Assets
plt.plot(df_cash_At_start_Of_Period.year,df_cash_At_start_Of_Period.cash, color="red")
plt.scatter(df_cash_At_start_Of_Period.year,df_cash_At_start_Of_Period.cash, color="red", label="Operating Cashflow
# Total Liabilities
plt.plot(df_cash_At_End_Of_Period.year,df_cash_At_End_Of_Period.cash, color="darkorange")
plt.scatter(df_cash_At_End_Of_Period.year,df_cash_At_End_Of_Period.cash, color="darkorange", label="Investing Cashf
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK")
plt.xlabel("Year")
plt.ylabel("Rupee")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
In [93]: debtRepayment = cashflow_annually.iloc[67]
debtRepayment
In [94]: year = []
cash = []
for k, v in debtRepayment.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [95]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
# Total Liabilities
plt.plot(df_debtRepayment.year,df_debtRepayment.cash, color="red")
plt.scatter(df_debtRepayment.year,df_debtRepayment.cash, color="white", label="Debt Repayments")
plt.ticklabel_format(axis='y', style='plain')
plt.title("HDFCBANK Repayment of Debt by Year")
ax.grid(color='white', alpha=0.20)
plt.legend(loc="upper left")
plt.show()
plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_debtRepayment.year, df_debtRepayment.cash, color="darkgrey")
plt.plot( df_debtRepayment.year, df_debtRepayment.cash, color="red", linestyle="--")
plt.scatter( df_debtRepayment.year, df_debtRepayment.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [96]: FreeCashFlow = cashflow_annually.iloc[68]
FreeCashFlow
In [97]: year = []
cash = []
for k, v in FreeCashFlow.items():
if k != 'breakdown': # skip the header
year.append(int(k))
cash.append(int(v))
In [98]: plt.style.use('dark_background')
fig, ax = plt.subplots(figsize=(12, 6))
plt.bar( df_FreeCashFlow.year, df_FreeCashFlow.cash, color="darkgrey")
plt.plot( df_FreeCashFlow.year, df_FreeCashFlow.cash, color="red", linestyle="--")
plt.scatter( df_FreeCashFlow.year, df_FreeCashFlow.cash, color="white", linestyle="--")
plt.ticklabel_format(axis='y', style='plain')
plt.xlabel("Year")
plt.title("HDFCBANK Free CashFlow by Year")
ax.grid(color='white', alpha=0.20)
plt.show()
In [ ]: