Slackbot
12/06/2022, 10:29 PMStefan Krawczyk
12/06/2022, 11:16 PMdef sample_field1(n:int)-> pd.DataFrame:
return DataFrame({'field1': [38115, 71525, 84920, 25997])
2. you want to cross join N of these dataframes.
3. you would like to understand how to model this with Hamilton.
Is that correct?Stefan Krawczyk
12/06/2022, 11:19 PMdef sample_field1(n:int)-> pd.DataFrame:
return DataFrame({'field1': [38115, 71525, 84920, 25997])
def sample_field2(...) -> pd.DataFrame:
...
def sample_field3(...) -> pd.DataFrame:
...
2. define the cross join explicitly:
def cross_join_of_fields(sample_field1: pd.DataFrame, sample_field2: pd.DataFrame, sample_field3: pd.DataFrame) -> pd.DataFrame:
# outputs a new dataframe that is the cross-join (merge with how='cross')
3. go and use it downstream
def some_other_function(cross_join_of_fields: pd.DataFrame) -> ...:
...
Stefan Krawczyk
12/06/2022, 11:26 PMsample functions
(e.g. using @parameterize). Otherwise for the cross join function, we require you to be explicit in naming the inputs to the function. If you end up having to change that function often then please chime in on this issue, which could help in this case.Baldo Faieta
12/07/2022, 1:49 AM