Skip to content

Commit 512900d

Browse files
committed
first correction
1 parent c6965ee commit 512900d

6 files changed

+217
-383
lines changed

docs/source/user_guide_data_exploration_charts.rst

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ Let's start with pies and histograms. Drawing the pie or histogram of a categori
2828

2929
.. code-block::
3030
31+
# Setting the plotting lib
3132
vp.set_option("plotting_lib", "highcharts")
33+
3234
titanic = load_titanic()
3335
titanic["pclass"].bar()
3436
3537
.. ipython:: python
3638
:suppress:
3739
40+
# Setting the plotting lib
3841
vp.set_option("plotting_lib", "highcharts")
3942
titanic = load_titanic()
4043
fig = titanic["pclass"].bar()
@@ -141,28 +144,28 @@ You can also change the occurences by another aggregation with the `method` and
141144
.. raw:: html
142145
:file: /project/data/VerticaPy/docs/figures/user_guides_data_exploration_titanic_age_hist_avs.html
143146

144-
145147
VerticaPy uses the same process for other graphics, like 2-dimensional histograms and bar charts.
146148

147149
Let us showcase another plotting library for these plots.
148150

149-
150151
.. code-block::
151-
152+
153+
# Setting the plotting lib
152154
vp.set_option("plotting_lib", "plotly")
155+
153156
titanic.bar(["pclass", "survived"])
154157
155158
.. ipython:: python
156159
:suppress:
157160
161+
# Setting the plotting lib
158162
vp.set_option("plotting_lib", "plotly")
159163
fig = titanic.bar(["pclass", "survived"])
160164
fig.write_html("/project/data/VerticaPy/docs/figures/user_guides_data_exploration_titanic_bar_pclass_surv.html")
161165
162166
.. raw:: html
163167
:file: /project/data/VerticaPy/docs/figures/user_guides_data_exploration_titanic_bar_pclass_surv.html
164168

165-
166169
.. note:: VerticaPy has three main plotting libraries. Look at :ref:`chart_gallery` section for all the different plots.
167170

168171
.. code-block::
@@ -242,7 +245,7 @@ Box plots are useful for understanding statistical dispersion.
242245
.. raw:: html
243246
:file: /project/data/VerticaPy/docs/figures/user_guides_data_exploration_titanic_boxplot_one.html
244247

245-
Scatter and bubble plots are also useful for identifying patterns in your data. Note, however, that these methods don't use aggregations; VerticaPy downsamples the data before plotting. You can use the 'max_nb_points' to limit the number of points and avoid unnecessary memory usage.
248+
Scatter and bubble plots are also useful for identifying patterns in your data. Note, however, that these methods don't use aggregations; VerticaPy downsamples the data before plotting. You can use the `max_nb_points` to limit the number of points and avoid unnecessary memory usage.
246249

247250
.. code-block::
248251
@@ -323,8 +326,10 @@ For more information on scatter look at :py:mod:`verticapy.vDataFrame.scatter`.
323326
Hexbin plots can be useful for generating heatmaps. These summarize data in a similar way to scatter plots, but compute aggregations to get the final results.
324327

325328
.. ipython:: python
326-
329+
330+
# Setting the plotting lib
327331
vp.set_option("plotting_lib", "matplotlib")
332+
328333
@savefig user_guides_data_exploration_iris_hexbin.png
329334
iris.hexbin(
330335
["SepalLengthCm", "SepalWidthCm"],
@@ -337,6 +342,7 @@ Hexbin, scatter, and bubble plots also allow you to provide a background image.
337342
.. code-block:: python
338343
339344
africa = load_africa_education()
345+
340346
# displaying avg students score in Africa
341347
africa.hexbin(
342348
["lon", "lat"],
@@ -349,6 +355,7 @@ Hexbin, scatter, and bubble plots also allow you to provide a background image.
349355
:suppress:
350356
351357
africa = load_africa_education()
358+
352359
# displaying avg students score in Africa
353360
@savefig user_guides_data_exploration_africa_hexbin.png
354361
africa.hexbin(
@@ -360,17 +367,6 @@ Hexbin, scatter, and bubble plots also allow you to provide a background image.
360367
361368
It is also possible to use SHP datasets to draw maps.
362369

363-
.. code-block:: python
364-
365-
africa = load_africa_education()
366-
# displaying avg students score in Africa
367-
africa.hexbin(
368-
["lon", "lat"],
369-
method = "avg",
370-
of = "zralocp",
371-
img = "img/africa.png",
372-
)
373-
374370
.. ipython:: python
375371
376372
# Africa Dataset
@@ -412,7 +408,9 @@ Since time-series plots do not aggregate the data, it's important to choose the
412408
:suppress:
413409
:okwarning:
414410
411+
# Setting the plotting lib
415412
vp.set_option("plotting_lib", "plotly")
413+
416414
fig = amazon["number"].plot(
417415
ts = "date",
418416
by = "state",

docs/source/user_guide_data_exploration_descriptive_statistics.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The :py:func:`~verticapy.vDataFrame.agg` method is the best way to compute multi
1717
help(vp.vDataFrame.agg)
1818
1919
This is a tremendously useful function for understanding your data.
20-
Let's use the `churn dataset <https://github.com/vertica/VerticaPy/tree/master/docs/source/notebooks/data_exploration/correlations/data>`_
20+
Let's use the `churn dataset <https://github.com/vertica/VerticaPy/blob/master/examples/business/churn/customers.csv>`_
2121

2222
.. code-block::
2323
@@ -122,7 +122,9 @@ You can also use the 'groupby' method to compute customized aggregations.
122122
"gender",
123123
"Contract",
124124
],
125-
["AVG(DECODE(Churn, 'Yes', 1, 0)) AS Churn"],
125+
[
126+
"AVG(DECODE(Churn, 'Yes', 1, 0)) AS Churn",
127+
],
126128
)
127129
128130
.. ipython:: python
@@ -133,7 +135,9 @@ You can also use the 'groupby' method to compute customized aggregations.
133135
"gender",
134136
"Contract",
135137
],
136-
["AVG(DECODE(Churn, 'Yes', 1, 0)) AS Churn"],
138+
[
139+
"AVG(DECODE(Churn, 'Yes', 1, 0)) AS Churn",
140+
],
137141
)
138142
html_file = open("/project/data/VerticaPy/docs/figures/user_guides_data_exploration_descriptive_stats_group_by.html", "w")
139143
html_file.write(res._repr_html_())
@@ -148,7 +152,10 @@ You can also use the 'groupby' method to compute customized aggregations.
148152
import verticapy.sql.functions as fun
149153
150154
vdf.groupby(
151-
["gender", "Contract"],
155+
[
156+
"gender",
157+
"Contract",
158+
],
152159
[
153160
fun.min(vdf["tenure"])._as("min_tenure"),
154161
fun.max(vdf["tenure"])._as("max_tenure"),
@@ -161,7 +168,10 @@ You can also use the 'groupby' method to compute customized aggregations.
161168
import verticapy.sql.functions as fun
162169
163170
res = vdf.groupby(
164-
["gender", "Contract"],
171+
[
172+
"gender",
173+
"Contract",
174+
],
165175
[
166176
fun.min(vdf["tenure"])._as("min_tenure"),
167177
fun.max(vdf["tenure"])._as("max_tenure"),

docs/source/user_guide_data_ingestion.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ To ingest the file into Vertica, remove the `genSQL` parameter from the above co
111111
:file: /project/data/VerticaPy/docs/figures/user_guide_data_ingestion_iris.html
112112

113113
When the file to ingest is not located on your local machine, and is on the server instead, then you must set the `ingest_local` parameter to False.
114+
114115
`ingest_local` is True by default.
115116

116117
.. note:: In some cases where the CSV file has a very complex structure, local ingestion might fail. If this occurs, you will have to move the file into the database and then ingest the file from that location.
@@ -130,8 +131,7 @@ syntax in the path parameter (in this case for multiple CSV files): `path = "pat
130131
Ingest CSV files
131132
----------------
132133

133-
In addition to :py:func:`~verticapy.read_file`, you can also ingest CSV files with the :py:func:`~verticapy.read_csv` function,
134-
which ingests the file using flex tables. This function provides options not available in :py:func:`~verticapy.read_file`, such as:
134+
In addition to :py:func:`~verticapy.read_file`, you can also ingest CSV files with the :py:func:`~verticapy.read_csv` function, which ingests the file using flex tables. This function provides options not available in :py:func:`~verticapy.read_file`, such as:
135135

136136
- `sep`: specify the column separator.
137137
- `parse_nrows`: the function creates a file of nrows from the data file to identify
@@ -140,18 +140,15 @@ the data types. This file is then dropped and the entire data file is ingested.
140140

141141
For a full list of supported options, see :py:func:`~verticapy.read_csv` or use the :py:func:`~verticapy.help` function.
142142

143-
In the following example, we will use :py:func:`~verticapy.read_csv` to ingest a
144-
subset of the Titanic dataset. To begin, load the entire Titanic dataset using the
145-
:py:func:`~verticapy.datasets.load_titanic` function:
143+
In the following example, we will use :py:func:`~verticapy.read_csv` to ingest a subset of the Titanic dataset. To begin, load the entire Titanic dataset using the :py:func:`~verticapy.datasets.load_titanic` function:
146144

147145
.. ipython:: python
148146
149147
from verticapy.datasets import load_titanic
150148
151149
titanic = load_titanic()
152150
153-
To convert a subset of the dataset to a CSV file, select the desired rows in
154-
the dataset and use the :py:func:`~verticapy.to_csv` vDataFrame method:
151+
To convert a subset of the dataset to a CSV file, select the desired rows in the dataset and use the :py:func:`~verticapy.to_csv` ``vDataFrame`` method:
155152

156153
.. ipython:: python
157154
@@ -163,7 +160,8 @@ Before ingesting the above CSV file, we can check its columns and their data typ
163160

164161
.. ipython:: python
165162
166-
vp.pcsv(path = "titanic_subset.csv",
163+
vp.pcsv(
164+
path = "titanic_subset.csv",
167165
sep = ",",
168166
na_rep = "",
169167
)
@@ -212,8 +210,7 @@ For a full list of supported options, see the :py:func:`~verticapy.read_json` or
212210

213211
VerticaPy also provides a :py:func:`~verticapy.pjson` function to parse JSON files to identify columns and their respective data types.
214212

215-
In the following example, we load the iris dataset using the :py:func:`~verticapy.datasets.load_iris` dataset,
216-
convert the vDataFrame to JSON format with the :py:func:`~verticapy.to_json` method, then ingest the JSON file into Vetica:
213+
In the following example, we load the iris dataset using the :py:func:`~verticapy.datasets.load_iris` dataset, convert the vDataFrame to JSON format with the :py:func:`~verticapy.to_json` method, then ingest the JSON file into Vetica:
217214

218215
.. code-block:: python
219216

0 commit comments

Comments
 (0)