File tree 2 files changed +39
-2
lines changed
2 files changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,40 @@ DataSource
6
6
.. autoclass :: pandas_visual_analysis.data_source.DataSource
7
7
:members:
8
8
:show-inheritance:
9
+
10
+ Advanced Usage of DataSource
11
+ ------------------------------
12
+
13
+ For getting started see the `basic usage guide <https://pandas-visual-analysis.readthedocs.io/en/latest/#usage >`_.
14
+
15
+ Read Data
16
+ ^^^^^^^^^^^
17
+
18
+ It is possible to read data directly from from files or URLs from the DataSource using default settings.
19
+
20
+ .. code-block :: python
21
+
22
+ from pandas_visual_analysis import DataSource
23
+ ds = DataSource.read_csv(" ./mpg.csv" )
24
+
25
+
26
+ To infer the file type from the extension use the ``read() `` method. Supported file types are: .csv, .tsv and .json.
27
+
28
+ .. code-block :: python
29
+
30
+ from pandas_visual_analysis import DataSource
31
+ ds = DataSource.read(" ./mpg.json" , orient = " columns" )
32
+
33
+ For more advanced options, use the functionality provided by `Pandas <https://pandas.pydata.org/pandas-docs/stable/reference/io.html >`_
34
+ and pass the DataFrame to DataSource normally.
35
+
36
+ Using DataSource as a context manager
37
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
+
39
+ Instead of assigning the DataSource object to a variable, it is also possible to use it as a context manager.
40
+
41
+ .. code-block :: python
42
+
43
+ from pandas_visual_analysis import DataSource, VisualAnalysis
44
+ with DataSource.read(" ./report.tsv" , header = 1 ) as ds:
45
+ VisualAnalysis(ds)
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ VisualAnalysis
8
8
:show-inheritance:
9
9
10
10
11
- Advanced Usage
12
- ----------------
11
+ Advanced Usage of VisualAnalysis
12
+ ----------------------------------
13
13
14
14
For getting started see the `basic usage guide <https://pandas-visual-analysis.readthedocs.io/en/latest/#usage >`_.
15
15
You can’t perform that action at this time.
0 commit comments