I am running one python script. I want to change particular row value without changing the other value. Can you please help me how to do this?
example:
df1
Table           Count
case            20
recordtype      50
consumer        70
settlement      150
address         250
bridge          130
I ran the process for only 'case' & 'consumer' job. Now new count in case and consumer is 80 & 150 but i am getting the file like this.
Table           Count
case            20
recordtype      50
consumer        70
settlement      150
address         250
case            80
consumer        150
It is not replacing the count value. It is just adding new column. But i want result like this:
df
Table           Count
case            80
recordtype      50
consumer        150
settlement      150
address         250
Can you please help me based on the Table name how can i replace the value?
I am using the below code:
if(os.path.isfile('/medaff/Scripts/python/count.txt')):
            df_s.to_csv('/medaff/Scripts/python/count.txt',mode='a', sep = '|', index= False, header=False)
else:
            df_s.to_csv('/medaff/Scripts/python/count.txt', sep = '|', index= False)
