CSV reader supporting strings

This function provides you with the data contained in a CSV file, column names and a term dictionary
165 download
Aggiornato 19 dic 2014

Visualizza la licenza

This function reads the data contain in a .csv file and transform it for its use. The function returns the next values:
data: contains the readed data. The columns that contains nominal values are transformed into numerical ones.
column_names: if the file contains a header, this variable saves the name of each column(*).
string_conversions: this variable contains the nominal values of the columns that have been transformed. If the column has numerical value, it contains {}. Otherwise, the nominal values are saved in column position.
(*)NOTE: In case of a entire nominal dataset with no header, the first example can be confused with header.

Example: the file contains the following data:
A,B,C,D
1,2,Sun,YES
3,1,Rain,YES
3,5,Sun,NO

Then, the function returns:
- data = [ 1 2 2 2
3 1 1 2
3 5 2 1]
- column_names = {'A','B','C', 'D'}
- string_conversions = {{}
{}
{'Rain' 'Sun'}
{'NO' 'YES'}}

Cita come

Pedro (2026). CSV reader supporting strings (https://it.mathworks.com/matlabcentral/fileexchange/48798-csv-reader-supporting-strings), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2014b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su String Parsing in Help Center e MATLAB Answers
Versione Pubblicato Note della release
1.0.0.0