import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
Data=pd.read_html("https://www.screener.in/shareholders/view/governmentofsingapore/")[0]
Data
Data.rename(columns={'Unnamed: 0':'Company'},inplace=True)
Investment=pd.DataFrame(Data.shape[0]-Data.isna().sum()[1:])
px.bar(data_frame=Investment,x=Investment.index,y=Investment[0].values,labels={'index':'Month-Year','y':'No. of Company Invested In'},title='Singapore Govt Investment')
MeltedData=pd.melt(Data,id_vars=['Company'])
MeltedData.rename(columns={'variable':'Month_Year'},inplace=True)
Company=list(MeltedData.Company.unique())
for i in Company:
fig=px.line(data_frame=MeltedData[MeltedData['Company']==i],x='Month_Year',y='value',title=i)
fig.show()