Skip to content

Commit 1c8d7a9

Browse files
committed
CSV File Import docs
1 parent 30c4b43 commit 1c8d7a9

File tree

8 files changed

+66
-0
lines changed

8 files changed

+66
-0
lines changed

doc/visual-programming/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Data
2323
:maxdepth: 1
2424

2525
widgets/data/file
26+
widgets/data/csvfileimport
2627
widgets/data/datasets
2728
widgets/data/sqltable
2829
widgets/data/save
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
CSV File Import
2+
===============
3+
4+
Import a data table from a CSV formatted file.
5+
6+
**Outputs**
7+
8+
- Data: dataset from the .csv file
9+
- Data Frame: pandas DataFrame object
10+
11+
The **CSV File Import** widget reads comma-separated files and sends the dataset to its output channel. File separators can be commas, semicolons, spaces, tabs or manually-defined delimiters. The history of most recently opened files is maintained in the widget.
12+
13+
*Data Frame* output can be used in the [Python Script](../data/pythonscript.md) widget by connecting it to the `in_object` input (e.g. `df = in_object`). Then it can be used a regular DataFrame.
14+
15+
### Import Options
16+
17+
The import window where the user sets the import parameters. Can be re-opened by pressing *Import Options* in the widget.
18+
19+
Right click on the column name to set the column type. Right click on the row index (on the left) to mark a row as a header, skipped or a normal data row.
20+
21+
![](images/CSVFileImport-ImportOptions-stamped.png)
22+
23+
1. File encoding. Default is UTF-8. See Encoding subchapter for details.
24+
2. Import settings:
25+
- *Cell delimiter*:
26+
- Tab
27+
- Comma
28+
- Semicolon
29+
- Space
30+
- Other (set the delimiter in the field to the right)
31+
- *Quote character*: either " or '. Defines what is considered a text.
32+
- *Number separators*:
33+
- Grouping: delimiters for thousands, e.g. 1,000
34+
- Decimal: delimiters for decimals, e.g. 1.234
35+
3. 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.
36+
- *Auto*: Orange will automatically try to determine column type. (default)
37+
- *Numeric*: for continuous data types, e.g. (1.23, 1.32, 1.42, 1.32)
38+
- *Categorical*: for discrete data types, e.g. (brown, green, blue)
39+
- *Text*: for string data types, e.g. (John, Olivia, Mike, Jane)
40+
- *Datetime*: for time variables, e.g. (1970-01-01)
41+
- *Ignore*: do not output the column.
42+
4. 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.
43+
44+
### Widget
45+
46+
The widget once the data is successfully imported.
47+
48+
![](images/CSVFileImport-widget-stamped.png)
49+
50+
1. 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.
51+
2. Information on the imported data set. Reports on the number of instances (rows), variables (features or columns) and meta variables (special columns).
52+
3. *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.
53+
54+
### Encoding
55+
56+
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*.
57+
58+
![](images/CSVFileImport-encodings.png)
59+
60+
Example
61+
-------
62+
63+
**CSV File Import** works almost exactly like the [File](../data/file.md) 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](../data/datatable.md) for inspection.
64+
65+
![](images/CSVFileImport-Example.png)
1.54 KB
Loading
-704 Bytes
Loading
129 KB
Loading
18.3 KB
Loading
7.48 KB
Loading
6.97 KB
Loading

0 commit comments

Comments
 (0)