Skip to content

Instantly share code, notes, and snippets.

@smedegaard
Created April 4, 2023 10:42
Show Gist options
  • Save smedegaard/12175b7e2dcde08130d8ae8d7ff9b993 to your computer and use it in GitHub Desktop.
Save smedegaard/12175b7e2dcde08130d8ae8d7ff9b993 to your computer and use it in GitHub Desktop.
from marvin import ai_fn
@ai_fn
def generate_data() -> list[str]:
"""
Generates a valid csv as a list of strings, with the columns 'foo', 'bar', 'baz'.
Where foo contains integers between 0 and 100
bar contains floats between -200 and 50
baz is randomized bollean values
The list should have minimum 10 rows, maximum 50 rows, including the header
"""
if __name__ == "__main__":
# code to be executed when the script is run as the main program
data = generate_data()
print(data)
#Output:
#['foo,bar,baz', '88,-68.359,true', '82,-60.474,false', '25,-25.833,false', '25,-27.535,true', '29,-44.827,true', '43,2.906,false', '11,3.527,false', '82,-104.775,true', '12,-113.290,false', '43,-96.333,true']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment