Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I have two tables -Source and Target,in Target I want to update values for one column randomly from source table
Hi @pphanireddy007 ,
You can use a code recipe in this case:
import dataiku
import pandas as pd, numpy as np
from dataiku import pandasutils as pdu
# Read recipe inputs
dataset_1 = dataiku.Dataset("airline_stocks_prepared")
df1 = dataset_1.get_dataframe()
dataset_2 = dataiku.Dataset("airline_stocks")
df2 = dataset_2.get_dataframe()
np.random.seed(123) # for reproducibility
df2['random_value'] = np.random.choice(df1['column_name'], size=len(df2))
# Write recipe outputs
result = dataiku.Dataset("result")
result.write_with_schema(df2)