Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- """
- Spyder Editor
- This is a temporary script file.
- """
- import numpy as np
- import pandas as pd
- data = np.array([[1,2,3],[4,5,6],[7,8,9],[10,11,13],[12,14,15]])
- print(data)
- df= pd.DataFrame(data)
- df.columns = list("ABC")
- def function(col):
- val=sum(col)/2
- return(val)
- print(function(df["A"]))
- =====================================================
- # -*- coding: utf-8 -*-
- """
- Created on Sun Feb 24 14:54:50 2019
- @author: DEll
- """
- import numpy as np
- import matplotlib.pyplot as plt
- x = np.arange(0,10)
- y=x^2
- plt.title("raph drawing")
- plt.xlabel("time")
- plt.ylabel("distance")
- plt.plot(x,y,'r')
- plt.plot(x,y,'>')
- #save in pdf format
- plt.savefig("time vs dist.pdf",format='pdf')
- ========================================================
- # -*- coding: utf-8 -*-
- """
- Created on Sun Feb 24 15:08:34 2019
- @author: DEll
- """
- import pandas as pd
- df = pd.read_csv(r"C:\Users\DEll\Downloads\HR_comma_sep.csv")
- ##
- #print(df.head(5))
- #print(df.tail(5))
- #print(df.info())
- #print(df.describe())
- #print(df[["satisfaction_level","salary","sales"]])
- df_copy=df.iloc[:500,[0,3,9]]
- df["col1"]=1
- df["new_salary"]=df["salary"].str.upper()+"_New"
- #print(df.describe())
- df_new = [(df["number_project"]>4)&(df["salary"]=="low")]
- df_new["number_project"].min()
- =============================================================
- # -*- coding: utf-8 -*-
- """
- Created on Sun Feb 24 16:05:25 2019
- @author: DEll
- """
- import matplotlib.pyplot as plt:plt.rcdefaults()
- import numpy as nb
- import matplotlib.pyplot as plt
- objects=('python','c++','java','pearl','scala','lisb')
- y_pos=nb.arange(len(objects))
- performance=[10,8,6,4,2,1]
- plt.bar(y_pos,performance,align='center')
- plt.xticks(y_pos,objects)
- plt.ylabel("usage")
- plt.title('programming language function')
- plt.show()
- =================================
- # -*- coding: utf-8 -*-
- """
- Created on Sun Feb 24 16:14:01 2019
- @author: DEll
- """
- import numpy as nb
- import matplotlib.pyplot as plt
- x=np.arange(0,3*np.pi,0.1)
- y=np.sin(x)
- plt.title('sine wave')
- plt.plot(x,y)
- plt.show()
- ==================================
- # -*- coding: utf-8 -*-
- """
- Created on Sun Feb 24 16:16:47 2019
- @author: DEll
- """
- import pandas as pd
- import numpy as np
- df =pd.DataFrame(np.random.rand(50,4),columns=['a','b','c','d'])
- df.plot.scatter(x='a',y='b')
- =============================
- # -*- coding: utf-8 -*-
- """
- Created on Sun Feb 24 16:20:07 2019
- @author: DEll
- """
- import pandas as pd
- import numpy as np
- df=pd.DataFrame(np.random.rand(10,5),columns=['a','b','c','d','e'])
- df.plot.box(grid='True')
- =======================================
Add Comment
Please, Sign In to add comment