0% found this document useful (0 votes)
6 views2 pages

Akhil 12 Ip

Uploaded by

tittimwon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Akhil 12 Ip

Uploaded by

tittimwon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

# coding: utf-8# In[1]:import pandas as pds=[1,2,3,2]y=pd.

Series(s)print(y)# In[ ]:
import pandas arr=[25,35,65,41]s=pd.Series(arr,index=['a','b','c','d'])print(s)as
pd# In[ ]:import pandas as pdarr=[25,55,65,84]s=pd.Series(arr)
s.index=['aa','bb','cc','dd']print(s) # In[ ]:import pandas as pd
a={'a':'akhil','b':'akhil','c':'akhil'}s=pd.Series(a)print(s)# In[ ]:import pandas
as pds=pd.Series('Akhil',index=[1,2,3,4,5,6,7])print(s)# In[ ]:import pandas as pd
import numpy as nparr=np.array([1,2,3,4])s=pd.Series(arr)print(s)# In[ ]:import
pandas as pdimport numpy as nparr=np.array([1,2,3])print(arr) # In[ ]:import
pandas as pds1=[1,2,3]s2=[2,3,4]s3=[3,4,5]s=pd.DataFrame([s1,s2,s3])print(s)#
In[ ]:import pandas as pds1={'arun':36,'rahul':45,'rohit':65}
s=pd.DataFrame(s1,index=['A','B','C'])print(s)# In[ ]:import pandas as pds1=[1,2,3]
s2=[2,3,4]s3=pd.Series(s1)s4=pd.Series(s2)print(s3+s4)# In[ ]:import pandas as pd
import numpy as nps1=np.array([10,12,14,16,18,20])r=pd.Series(s1,dtype=np.float64)
print(r)print(s1)# In[ ]:import pandas as pds=[[1,2,3],[2,3,4]]df=pd.DataFrame(s)
print(df.loc[1,1]# In[ ]:import pandas as pdd={'name':
['anumod','arun','amal','arun','arjun'],'degree':
['B.PED','BBA','BCA','B.COM','B.TECH'],'score':[100,90,100,80,50],'grade':
['A','B','A','C','E'],'regno':[1,2,3,4,5],'rank':[3,5,7,6,30]}df=pd.DataFrame(d)
print(df)# In[ ]:import pandas as pda=[40,56,89,25,64,35,54,62,23,50]
term1=pd.Series(a,index=[1,2,3,4,5,6,7,8,9,10])b=[60,52,35,56,89,54,62,31,52,23]
term2=pd.Series(b,index=[1,2,3,4,5,6,7,8,9,10])c=[54,98,89,89,98,56,41,23,45,85]
term3=pd.Series(c,index=[1,2,3,4,5,6,7,8,9,10])x=term1*25/100y=term2*25/100
z=term3*50/100weightedmark=x+y+zprint(weightedmark)# In[ ]:import pandas as pd
d={'name':['anumod','arun','amal','arun','arjun'],'degree':
['B.PED','BBA','BCA','B.COM','B.TECH'],'score':[100,90,100,80,50],'grade':
['A','B','A','C','E'],'regno':[1,2,3,4,5],'rank':[3,5,7,6,30]}df=pd.DataFrame(d)
print(df['name'])# In[ ]:import pandas as pd
r=[{'itemcategory':'electronics','itemname':'phone','expenditure':12000},
{'itemcategory':'food','itemname':'biriyani','expenditure':300},
{'itemcategory':'stationery','itemname':'pen','expenditure':10},
{'itemcategory':'vehicle','itemname':'lamborgini','expenditure':200000000},
{'itemcategory':'utensils','itemname':'pan','expenditure':500}]df=pd.DataFrame(r)
print(df)# In[4]:import pandas as pd df=pd.read_csv('C://akhil//akhil.csv')
print(df)# In[35]:import matplotlib.pyplot as plt x=[10,20,30,40,50,60]
y=[20,30,40,50,60,70]plt.xlabel('income')plt.ylabel('AD')plt.title('Normal line
graph')plt.plot(x,y,color='k')
plt.plot(x,y,marker='^',markersize='5',markeredgecolor='black')plt.show()# In[18]:
import matplotlib.pyplot as plt x=[10,20,30,40,50,60]y=[20,30,40,50,60,70]
plt.xlabel('income')plt.ylabel('AD')plt.title('Normal line graph')
plt.bar(x,y,8,color=['c','g','r','g'])plt.show()# In[ ]:import matplotlib.pyplot as
plt x=[10,20,30,40,50,60]y=[20,30,40,50,60,70]plt.xlabel('income')plt.ylabel('AD')
plt.title('Normal line graph')plt.hist(x,bins=y)plt.show()# In[12]:import
matplotlib.pyplot as plt x=[10,20,30,40,50,60]y=[20,30,40,50,60,70]
plt.bar(x,y,4,color='k',label='africa')plt.xlabel('income')plt.ylabel('AD')
plt.title('Normal line graph')plt.legend(loc='right')plt.show()# In[20]:import
matplotlib.pyplot as plt x=[10,20,30,40,50,60]y=[20,30,40,50,60,70]
plt.xlabel('income')plt.ylabel('IN')plt.title('Normal line graph')
plt.barh(x,y,8,color=['c','g','r',''])plt.show()# In[21]:import numpy as npimport
pandas as pdfrom pandas import Series, DataFrameimport matplotlib.pyplot as pltdata
= [23, 45, 56, 78, 213]plt.bar(range(len(data)), data, color='royalblue',
alpha=0.7)plt.grid(color='#95a5a6', linestyle='--', linewidth=2, axis='y',
alpha=0.7)plt.show()# In[19]:import matplotlib.pyplot as plt x = [0, 0.5, 1, 0.75,
0.25, 0]y = [0, 1, 0, 0.5, 0.5, 0]plt.xlabel('income')plt.ylabel('NUMBERS')
plt.title('NAME')plt.plot(x,y,color='k')plt.show()# In[22]:import matplotlib.pyplot
as plt x = y = plt.xlabel('income')plt.ylabel('NUMBERS')plt.title('NAME')
plt.plot(x,y,color='k')plt.show()# In[59]:import numpy as np import
matplotlib.pyplot as pltnm=['akhil','basanth','sreerag','sabari']
x=np.array(range(len(nm)))d1=(200,310,170,275)d2=(210,240,250,280)
d3=(205,330,320,295)plt.bar(nm,d1,label='money',width=0.2,color='k')
plt.bar(x+0.2,d2,label='capital',width=0.2,color='r')
plt.bar(x+0.4,d3,label='profit',width=0.2,color='c')plt.xlabel('names')
plt.label('numbers')plt.legend()plt.show()# In[54]:import numpy as np import
matplotlib.pyplot as pltnm=['akhil','basanth','sreerag','sabari']
x=np.array(range(len(nm)))d1=(20,40,60,80)d2=(200,400,600,800)d3=(300,600,900,400)
plt.bar(nm,d1,label='money',width=0.2,color='k')
plt.bar(x+0.2,d2,label='capital',width=0.2,color='r')
plt.bar(x+0.4,d3,label='profit',width=0.2,color='c')plt.legend()plt.show()# In[25]:
import matplotlib.pyplot as plt x=[10,20,30,40,50,60]y=[20,30,40,50,60,70]
plt.xlabel('income')plt.ylabel('AD')plt.title('Normal line graph')
plt.plot(x,y,color='k')
plt.plot(x,y,marker='^',markersize='5',markeredgecolor='black')
plt.plot(x,y,linestyle='dashdot',linewidth=5,color='k')plt.legend('PRO')plt.show()

You might also like