Difference between revisions of "Orange: CSV File Import"

From OnnoWiki
Jump to navigation Jump to search
Line 64: Line 64:
 
CSV File Import works almost exactly like the File widget, with the added options for importing different types of .csv files. In this workflow, the widget read the data from the file and sends it to the Data Table for inspection.
 
CSV File Import works almost exactly like the File widget, with the added options for importing different types of .csv files. In this workflow, the widget read the data from the file and sends it to the Data Table for inspection.
  
../../_images/CSVFileImport-Example.png
+
[[File:CSVFileImport-Example.png|center|600px|thumb]]
 
 
 
 
  
 
==Referensi==
 
==Referensi==

Revision as of 17:38, 9 January 2020

Sumber: https://docs.biolab.si//3/visual-programming/widgets/data/csvfileimport.html

Import data table dari CSV formatted file.

Output

Data: dataset dari .csv file
Data Frame: pandas DataFrame object

CSV File Import widget membaca comma-separated file dab mengirimkan dataset ke output channel. File separator bisa berupa comma, semicolon, space, tab atau manually-defined delimiters. History dari file yang baru dibuka di maintain di widget.

Data Frame output dapat digunakan di Python Script widget dengan menyambungkannya ke in_object input (seperti, df = in_object). Sehingga dia bisa digunakan seperti DataFrame biasa.

Import Option

Import window tempat pengguna menetapkan parameter impor. Dapat dibuka kembali dengan menekan Opsi Impor di widget.

Klik kanan pada nama kolom untuk mengatur jenis kolom. Klik kanan pada indeks baris (di sebelah kiri) untuk menandai baris sebagai header, di skip atau baris data normal.

CSVFileImport-ImportOptions-stamped.png


  • File encoding. Default is UTF-8. See Encoding subchapter for details.
  • Import settings:
    • Cell delimiter:
      • Tab
      • Comma
      • Semicolon
      • Space
      • Other (set the delimiter in the field to the right)
    • Quote character: either “ or ‘. Defines what is considered a text.
    • Number separators:
      • Grouping: delimiters for thousands, e.g. 1,000
      • Decimal: delimiters for decimals, e.g. 1.234
  • Column type: select the column in the preview and set its type. Column type can be set also by right-clicking on the selected column.
    • Auto: Orange will automatically try to determine column type. (default)
    • Numeric: for continuous data types, e.g. (1.23, 1.32, 1.42, 1.32)
    • Categorical: for discrete data types, e.g. (brown, green, blue)
    • Text: for string data types, e.g. (John, Olivia, Mike, Jane)
    • Datetime: for time variables, e.g. (1970-01-01)
    • Ignore: do not output the column.
  • Pressing Reset will return the settings to the previously set state (saved by pressing OK in the Import Options dialogue). Restore Defaults will set the settings to their default values. Cancel aborts the import, while OK imports the data and saves the settings.

Widget

The widget once the data is successfully imported.

../../_images/CSVFileImport-widget-stamped.png

   The folder icon opens the dialogue for import the local .csv file. It can be used to either load the first file or change the existing file (load new data). The File dropdown stores paths to previously loaded data sets.
   Information on the imported data set. Reports on the number of instances (rows), variables (features or columns) and meta variables (special columns).
   Import Options re-opens the import dialogue where the user can set delimiters, encodings, text fields and so on. Cancel aborts data import. Reload imports the file once again, adding to the data any changes made in the original file.

Encoding

The dialogue for settings custom encodings list in the Import Options - Encoding dropdown. Select Customize Encodings List… to change which encodings appear in the list. To save the changes, simply close the dialogue. Closing and reopening Orange (even with Reset widget settings) will not re-set the list. To do this, press Restore Defaults. To have all the available encodings in the list, press Select all.

../../_images/CSVFileImport-encodings.png

Contoh

CSV File Import works almost exactly like the File widget, with the added options for importing different types of .csv files. In this workflow, the widget read the data from the file and sends it to the Data Table for inspection.

CSVFileImport-Example.png

Referensi

Pranala Menarik