check_for_CID.py
AI for Chemistry/2025_COSMO/data/s-profiles-all/check/check_for_CID.py
import csv
import os
def remove_duplicates_from_csv(input_file, output_file):
total_rows = 0
with open(input_file, 'r', newline='') as infile, open(output_file, 'w', newline='') as outfile:
reader = csv.reader(infile)
writer = csv.writer(outfile)
# Skip the header row
next(reader)
for row in reader:
cleaned_row = list(set(row))
writer.writerow(cleaned_row)
total_rows += 1
return total_rows
if __name__ == "__main__":
# input_csv_file = r"C:\Users\user\Desktop\COSMOSAC-master\COSMO\COSMO_all\s-profiles-all\check\check.csv"
input_csv_file = r"C:\Users\user\Desktop\COSMOSAC-master\COSMO\COSMO_all\s-profiles-all\check\check_2.csv"
output_csv_file = r"C:\Users\user\Desktop\COSMOSAC-master\COSMO\COSMO_all\s-profiles-all\check\gjf_checked_2.csv"
# output_csv_file = r"C:\Users\user\Desktop\COSMOSAC-master\COSMO\COSMO_all\s-profiles-all\check\name_checked_2.csv"
total_rows = remove_duplicates_from_csv(input_csv_file, output_csv_file)
print(f"Duplicates removed from {input_csv_file}. Cleaned data saved to {output_csv_file}.")
print(f"Total number of rows in cleaned CSV (excluding header): {total_rows}")
Artigos relacionados
cosmo_to_s_profile_ver_1.1.1.py
cosmo_to_s_profile_ver_1.1.1.py — python source code from the AI for Chemistry learning materials (AI for Chemistry/2025_COSMO/data/s-profiles-all/List-9/cosmo_to_s_profile_ver_1.1.1.py).
Ler artigo →area.py
area.py — python source code from the AI for Chemistry learning materials (AI for Chemistry/2025_COSMO/data/s-profiles-all/area_volume-org/area.py).
Ler artigo →area_volume.py
area_volume.py — python source code from the AI for Chemistry learning materials (AI for Chemistry/2025_COSMO/data/s-profiles-all/area_volume-org/area_volume.py).
Ler artigo →volume.py
volume.py — python source code from the AI for Chemistry learning materials (AI for Chemistry/2025_COSMO/data/s-profiles-all/area_volume-org/volume.py).
Ler artigo →check_final_CID.py
check_final_CID.py — python source code from the AI for Chemistry learning materials (AI for Chemistry/2025_COSMO/data/s-profiles-all/check/check_final_CID.py).
Ler artigo →cosmo.py
cosmo.py — python source code from the AI for Chemistry learning materials (AI for Chemistry/2025_COSMO/data/s-profiles-all/check/cosmo.py).
Ler artigo →