0

This is my data frame How can i copy the Previous Record and Paste as Last Record, clear Values ONLY and then add to same data frame.

 Record  Data Cust_Name   Position  Val  Formula                        id

0      41    30      John  Developer   41     21.0  =CONCATENATE(B2, "-",D2)

1      51    40       Tom  Developer   51     40.0  =CONCATENATE(B3, "-",D3)

2      32    21     Bruce     Tester   11      NaN  =CONCATENATE(B4, "-",D4)

3      71    60   Mamooty  Developer   51      NaN  =CONCATENATE(B5, "-",D5)
Umar.H
  • 22,559
  • 7
  • 39
  • 74
Joji k joy
  • 33
  • 9
  • What's your expected output, and show your input. not clear to me what you're after. – Umar.H Jan 10 '20 at 10:58
  • I think you want join 2 columns together, check answers in dupe and if still problem add your code to question with expected output. – jezrael Jan 10 '20 at 11:00
  • `df['first_column'].astype(str).add('-').add(df['second_column'].astype(str))` or `df['first_column'].astype(str).str.cat(df['second_column'].astype(str),sep = '-')` – ansev Jan 10 '20 at 11:03
  • @Datanovice Thanks in Advance, I am new to python development. I have obtained above DataFrame using pandas. I am able to write to excel using data frame, but the formulas that I have added is only applicable to the above mention rows. How to add a new record when this is the last record? This is a problem, because in Excel if you add a new last record, the Formulas are not copied. So, in this scenario, can i copy the Previous Record and Paste as Last Record, clear Values ONLY and then use this record to overwrite with the new values? – Joji k joy Jan 10 '20 at 11:03
  • why not just concatenate it in Pandas? you can do as ansev has said? if you need more help re-formulate ur question with epxefed output – Umar.H Jan 10 '20 at 11:07
  • @ansev How to add a new row in excel sheet with previous row formula and not values. I have an excel with rows contains both formula and values I need to get the formulas only. By using pandas or any other library. – Joji k joy Jan 10 '20 at 11:18

0 Answers0