if 14<=int(str(datetime.datetime.now().hour))<=18:
try:
warnings.simplefilter(action=’ignore’, category=DeprecationWarning)
warnings.simplefilter(action=’ignore’, category=FutureWarning)
df_new=pd.read_csv(‘AllCarsSorted.csv’,low_memory=False)
df=df_new
df = df[df[‘Link’].notna()]
m = df[‘Link’].str.contains(‘https’)
df = df[m]
df[‘Price’] = df[‘Price’].astype(str)
df[‘KMs’] = df[‘KMs’].astype(str)
df[‘Year’] = df[‘Year’].astype(str)
df[‘Price’] = df[‘Price’].str.replace(‘.0’,”)
df[‘KMs’] = df[‘KMs’].str.replace(‘.0’,”)
df[‘Year’] = df[‘Year’].str.replace(‘.0’,”)
df[‘Price’] = df[‘Price’].str.replace(‘,’,”)
df[‘KMs’] = df[‘KMs’].str.replace(‘,’,”)
df[‘Year’] = df[‘Year’].str.replace(‘,’,”)
df=df[df[‘KMs’].map(lambda x: x.isdigit())]
df=df[df[‘Year’].map(lambda x: x.isdigit())]
df=df[df[‘Price’].map(lambda x: x.isdigit())]
df[‘Price’]=df[‘Price’].astype(int)
df[‘KMs’]=df[‘KMs’].astype(int)
df[‘Year’]=df[‘Year’].astype(int)
df[‘Make’] = df[‘Make’].str.strip()
df[‘Model’] = df[‘Model’].str.strip()
df_new=df
from saving import read
df_new=df_new.loc[(df_new[‘IGNORE’] !=’Yes’)&(df_new[‘KMs’] < 1000)&(df_new[‘Year’] < int(datetime.datetime.now().year)-1)&(df_new[‘Regional Specs’]==’GCC’)&(df_new[‘Source’]!=’Sayarati’)]
df_oldies_rows=df_new
try:
df_oldies_old=pd.read_excel(‘review2.xlsx’)
df_oldies_old.replace(‘nan’, ”, regex=True,inplace=True)
df_oldies_rows=df_oldies_rows.loc[~df_oldies_rows[‘Link’].isin(list(df_oldies_old.loc[:,’Link’]))]
except:
df_oldies_old=pd.DataFrame()
saving.send_notification_review2(df_oldies_rows.to_dict('records'))
df_oldies_last=pd.concat([df_oldies_rows,df_oldies_old],ignore_index=True)
df_oldies_last.to_excel('review2.xlsx',index=False)
except:
traceback.print_exc()
pass
Sell any car cash todayWant to know to calculate the payments of any used car in UAE