diff --git a/scripts/ingests/ingest_bard14_spectra.py b/scripts/ingests/ingest_bard14_spectra.py index a15e03ba6..9b59e04d1 100644 --- a/scripts/ingests/ingest_bard14_spectra.py +++ b/scripts/ingests/ingest_bard14_spectra.py @@ -35,7 +35,7 @@ #Loop through data and update spectra #def updating_spectra(db): - # for row in bard14_table[0:19]: +#for row in bard14_table[0:19]: # Print spectra information # print("Spectra Information:") @@ -48,15 +48,21 @@ #Ingest spectra loop 2 -def update_all_spectra(db): +#def update_all_spectra(db): #updating_spectra(db) - - with db.engine.begin() as conn: - for entry in update_all_spectra: - source_value = entry['Source'] - spectrum_value = entry['Spectrum'] - original_spectrum_value = entry['Original Spectrum'] +# with db.engine.begin() as conn: +# for entry in update_all_spectra: +# source_value = entry['Source'] +# spectrum_value = entry['Spectrum'] +# original_spectrum_value = entry['Original Spectrum'] +#function to update all spectra in the database +def update_all_spectra(db): + with db.engine.begin() as conn: + for index, row in bard14_table.iterrows(): + source_value = row['Source'] + spectrum_value = row['Spectrum'] + original_spectrum_value = row['Original Spectrum'] #update data in loop