0

i have the following dataframe on which i am trying to add a new column taking values from existing dataframe from each row, can anyone please guide what needs to be done to take value from existing dataframe and insert it in new column.

import pandas as pd

data = {
  "Ticker": ['MSUSDSP5', 'MSUSSPVP', 'MSCBICC0'],
  "Levels": [50, 40, 45],
  "Pkey": [71763307, 5456454, 5454587],
  "Date": ['16Jun2022', '16Jun2022', '16Jun2022'],

}

#load data into a DataFrame object:
df = pd.DataFrame(data)

 

df['sql_query'] = 'call CORE_VALUATIONS.VALUATIONS.INSERTEQCLOSINGPRICE(%s, %s, %s, NULL, NULL)' %  (df['Pkey'], df['Date'], df['Level']
print(df)

Desired output: enter image description here

Rahul Vaidya
  • 189
  • 2
  • 12

0 Answers0