Jan-14-2024, 03:56 AM
Hi, I would like help with a code to align left and top and change font size to 10 similar to VBA code. The code I am creating is below, cheers.
import pandas as pd inspdata=pd.read_excel('Inspections data.xlsx') #remove columns inspdata.drop(['Notice Creation','count()'],axis=1, inplace=True) #replace header row names inspdata.columns=['EForm ID','Contractor','Address','Area','Classification','Program','Notice Ref #','Category','Inspection Type', 'Result','Actual Date','Created Date','Status','CIO','PO'] #delete first 4 rows below the header inspdata.drop([0,1,2,3],axis=0,inplace=True) #keeps header row #replace text inspdata['Classification'].replace(['VACQREP','VACAP'],['VAC','VAC'],inplace=True) print(inspdata.head(10)) inspdata.to_excel('Inspections Data Python.xlsx',index=False)Below is the code I use in VBA and would like the same in Python.
'VBA code select whole range to configure Range("A1").CurrentRegion. HorizontalAlignment = xlLeft Range("A1").CurrentRegion. VerticalAlignment = xlTop Range("A1").CurrentRegion. Font.Size = 10