Category Archives: Python

Using Index DataFrame Python

#Using Dataframes import numpy as np import pandas as pd data=[1,2,3,4,5] data=pd.DataFrame(data,index=[‘range’,’range1′,’range2′,’range3′,’range4′]) print(data) Advertisements

Posted in Python, Uncategorized | Leave a comment

Using Series Pandas

import numpy as np import pandas as pda data=np.array([1,2,3,4]) p=pda.Series(data) print(p)

Posted in Python, Uncategorized | Leave a comment

Using Series in Python

import numpy as np import pandas from pandas import Series,DataFrame obj=Series([3,6,9,12]) print(obj) obj=Series([3,6,9,12],index=[0,1,2,3]) print(obj[1])

Posted in Python, Uncategorized | Leave a comment

Using Classes Python

class Employee: empcount=0; def __init__(self,name,salary,id=780): self.name=name self.salary=salary self.id=id def display(self): print(“Employee name is “,self.name,”Employee salary is “,self.salary,”Id seen is “,self.id) e=Employee(“Ashish”,200) e.display()

Posted in Python, Uncategorized | Leave a comment

Using Dictionary

dict={‘Name’:’Ashish’,’Age’:25} print(dict[‘Name’]) print(‘Age is ‘,dict[‘Age’]) print(len(dict)) dict.clear() #Delete dictionary del dict #print(dict.name)

Posted in Python, Uncategorized | Leave a comment

Print Numbers from 1 to 10 and use while loop

tup1=(“physics”,”chemitry”) print(tup1[0]) print(len(tup1)) print(max(tup1)) for letter in tup1: print(letter) i=0 while i != len(tup1): print(tup1[i]) i=i+1

Posted in Python, Uncategorized | Leave a comment

Open Browser using Python and without webdriver

import webbrowser webbrowser.open(‘https://www.google.com/’)

Posted in Python, Uncategorized | Leave a comment