0
我正在使用Python的Flask將3D圖形的X,Y,Z值賦給Javascript(Plotly庫)。數據是這樣的:如何使用SQLAlchemy/Mysql存儲3D圖形(x,y,z)數據?
z = [1,1,1,1,1,1,1,1,1,1,1,1];
x = [0.0100,0.0420,0.0500,0.0508,0.0769,0.0883,0.0900,0.1101,0.1256,0.1300,0.1385,0.1607];
y = [0.0131,0.0190,0.0248,0.0250,0.0310,0.0370,0.0384,0.0430,0.0490,0.0530,0.0550,0.0610];
問題是,我會在我的網站很多3D圖形和他們都儲存在代碼中的Python數組很荒謬。將所有這些座標存儲在數據庫中最有效的方法是什麼?謝謝。
您可以將這些變量轉換爲JSON並將其轉換成字符串,並將其存儲到數據庫,但是你需要再次轉換回得到時字符串值。 –