combine5
This commit is contained in:
@@ -4,7 +4,7 @@ from firebase_admin import credentials
|
||||
from firebase_admin import firestore
|
||||
from google.cloud.firestore_v1.base_query import FieldFilter
|
||||
import pandas as pd
|
||||
import datetime
|
||||
from datetime import datetime
|
||||
import sys
|
||||
import os
|
||||
|
||||
@@ -53,13 +53,16 @@ df = pd.DataFrame(data)
|
||||
print(df)
|
||||
print(df.size)
|
||||
|
||||
df = df[["_id", "classificationResult", "calculatedRatio", "deviceId", "deviceRatio", "deviceType", "kitSerial", "led1Average", "led1Buffer", "led1Sample", "led2Average", "led2Buffer", "led2Sample", "location", "deviceSerialNumber", "name", "testTime"]]
|
||||
|
||||
# Save the DataFrame to a CSV file
|
||||
output_filename = "data.csv"
|
||||
df.to_csv(output_filename, index=False)
|
||||
output_filename = f'tests_{datetime.today().strftime("%d_%m_%Y_%H_%M")}.xlsx'
|
||||
|
||||
downloads_dir = os.path.join(os.path.expanduser("~"), "Downloads")
|
||||
output_path = os.path.join(downloads_dir, output_filename)
|
||||
df.to_csv(output_path, index=False)
|
||||
writer = pd.ExcelWriter(output_path, engine = 'openpyxl')
|
||||
df.to_excel(writer, sheet_name = 'data', index=False)
|
||||
writer.close()
|
||||
|
||||
print(f"Data saved to '{output_path}'")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user