Comparing 2 dataframe. get rid of word timestamp and limit output to 2 decimal points

Hi all, I am comparing 2 data frames. please can someone advice how I can limit numbers to 2 decimal points and get rid of word Timestamp. out put of the code is pasted below

When I paste the code here the formatting is messed up. but the code works fine in sublime Test

Python program to read an excel file

import pandas as pd

import numpy as np
import warnings

Give the location of the file

path = ‘C:/Users/ambar/OneDrive/Desktop/dummy/a1b.xlsx’
df= pd.read_excel(path, sheet_name=‘Sheet1’, usecols=[‘Date’,‘name’, ‘myname’, ‘fx’])
ds= pd.read_excel(path, sheet_name=‘Sheet1’, usecols=[‘Date’])
df2= pd.read_excel(path, sheet_name=‘Sheet1’, usecols=[‘Date’,‘name1’, ‘myname1’, ‘fx1’])


df1= df.copy()

Calculate percentage change in dataframe

df[[‘name’,‘myname’,‘fx’]] = df[[‘name’,‘myname’,‘fx’]].pct_change(periods = 5)

print(“Number of Exceptions in columns: Date Name myname fx are:”)
print(“Number of Exceptions are:”, sum(np.array(df)>np.array(df2)))
print (“\n\n”)

list_of_column_names = list(df.columns)

displaying the list of column names


b = np.where(df[‘name’]> df2[‘name1’])

print (a[b])

print (“\n\n”)


print (“\n\n”)
b = np.where(df[‘myname’]> df2[‘myname1’])
print (a[b])

print (“\n\n”)


[‘Date’, ‘name’, ‘myname’, ‘fx’]
[[Timestamp(‘2000-11-16 00:00:00’) 5.0 19.0 -0.5]
[Timestamp(‘2000-11-17 00:00:00’) 2.5 15.5 0.3999999999999999]
[Timestamp(‘2000-11-18 00:00:00’) 1.6666666666666665 1.0 0.0]
[Timestamp(‘2000-11-19 00:00:00’) 1.25 0.33333333333333326
[Timestamp(‘2000-11-27 00:00:00’) 3.666666666666667 1.6666666666666665
[Timestamp(‘2000-11-28 00:00:00’) 2.8333333333333335 0.0
[Timestamp(‘2000-11-29 00:00:00’) 3.0 -0.33333333333333337