Appending data to a CSV file within a flask app
Hi! As seen in the title, I can't seem to add/append data or text to the csv that I have uploaded to my flask app that is being deployed in Google Cloud Run. But when I try it locally using Jupyter Notebook, it seems to work just fine.
Here is the code:
#load the csv
features = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
url_data = pd.read_csv("RetrainDatabase.csv",low_memory=False)
#append the new data features
url_data.loc[len(url_data )] = features
#save the new csv
url_data.to_csv("RetrainDatabase_V2.csv", index=False)
/r/flask
https://redd.it/13fcehr
Hi! As seen in the title, I can't seem to add/append data or text to the csv that I have uploaded to my flask app that is being deployed in Google Cloud Run. But when I try it locally using Jupyter Notebook, it seems to work just fine.
Here is the code:
#load the csv
features = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
url_data = pd.read_csv("RetrainDatabase.csv",low_memory=False)
#append the new data features
url_data.loc[len(url_data )] = features
#save the new csv
url_data.to_csv("RetrainDatabase_V2.csv", index=False)
/r/flask
https://redd.it/13fcehr
Reddit
r/flask on Reddit: Appending data to a CSV file within a flask app
Posted by u/Xylluxov - No votes and no comments