openalea.ratp.IOtable#

Input/output functions for tables in csv or txt format. This module may be rewrite for efficiency using pandas library.

Functions

N_lignes(fichier)

Count the number of lines in a file without changing the file pointer position

conv_dataframe(tab)

convert list of list into dictionary of lists with 1st row as key.

conv_list(tab)

convert dictionary of lists into list of lists with key as first element of each list

conv_list2(tab)

convert dictionary into list of lists with key as first element of each list

copie_partielle(fichier, out, n, m)

copy lines from n to m from fichier to out

ecriture_csv(table, fichier)

write table (list of list) of numbers into a csv file

ecriture_txt(table, fichier)

write table (list of list) of numbers into a txt file

extract_dataframe(dat, ls_cles, cle[, val, oper])

extract from dat (dictionary of lists) a sub-dictionary where dat[cle] respect cle ival val option oper : 'egal', 'inf', 'sup', 'infeg', 'supeg', 'diff'

t_list(tab)

transpose tab

table_csv(fichier)

transcribe a .csv file into a table (list of list) of floats

table_csv_str(fichier)

transcribe a .csv file of strings into a table (list of list) of strings

table_txt(fichier)

transcribe a .txt file into a table (list of list) of strings

transcript_csv(fichier)

Convert a line of csv into a list of float

transcript_csv_str(fichier)

Convert a line of csv into a list of float

transcript_txt(fichier)

Convert a line of txt into a list of strings

write_dict(dict, directory, name)