-
data
- required key with a list of lists -
filename
- optional. if not added, a timestamped file name will be used -
other keys are ignored
-
Example data:
{
"data": [["Gender","NA","NA"],["Grade","5.13492063492064","5.13492063492064"],["Age","10.4259259259259","10.4259259259259"],["Race","NA","NA"],["Urban/Rural","NA","NA"],["School","NA","NA"],["Goals","NA","NA"],["Grades","2.6031746031746","2.6031746031746"],["Sports","2.05026455026455","2.05026455026455"],["Looks","2.11640211640212","2.11640211640212"],["Money","3.23015873015873","3.23015873015873"]],
}
- The data is first transposed, then written
{
"success": true,
"message": "file created!",
"data": {
"filename": "/ravens_volume/test_output/185_baseball/temp_storage_root/ta3_data/data_2018-08-08_18-34-51_dtqow.csv",
"timestamp": "2018-08-08T18:34:51.343"
}
}
- Input
{
"data": [1, 2, 3, 4]
}
- Output
{
"success": false,
"message": "Failed to transpose the data. The data should be a row of rows. Error: zip argument #1 must support iteration"
}
- Input
{
"filename": "dirname/myfile.csv",
"data": [["Gender","NA","NA"],["Grade","5.13492063492064","5.13492063492064"],["Age","10.4259259259259","10.4259259259259"],["Race","NA","NA"],["Urban/Rural","NA","NA"],["School","NA","NA"],["Goals","NA","NA"],["Grades","2.6031746031746","2.6031746031746"],["Sports","2.05026455026455","2.05026455026455"],["Looks","2.11640211640212","2.11640211640212"],["Money","3.23015873015873","3.23015873015873"]]
}
- Output: note position of
dirname/myfile.csv
{
"success": true,
"message": "file created!",
"data": {
"filename": "/ravens_volume/test_output/185_baseball/temp_storage_root/ta3_data/dirname/myfile.csv",
"timestamp": "2018-08-08T18:43:19.688"
}
}