list data storage

1

Import numpy AS NP
 Import numpy AS NP
 Import CSV
 Import the codecs 

DEF data_write_csv (file_name, datas):         # file_name CSV file path written, datas list of data to be written 
    DATAS = List (Map ( the lambda X: [X], DATAS)) 
    file_csv = codecs.open (file_name, ' W + ' , ' UTF-. 8 ' ) 
    Writer = csv.writer (file_csv, DELIMITER = '  ' , quotechar = '  ' , quoting = csv.QUOTE_MINIMAL)
     for Data in DATAS:
        writer.writerow (Data) 
    Print ( " Save File successful, the process ends " ) 

A = [3,3,3,44,4,4335,444,44,44,4,56,6 ] 

data_write_csv ( ' ./a .csv ' , A)

 

Guess you like

Origin www.cnblogs.com/xxswkl/p/10962489.html