Skip to content

Commit 2165298

Browse files
TypingKoalaJohnny Bui
andauthored
add example of dataframe access and minor spelling fixes (#20)
Co-authored-by: Johnny Bui <[email protected]>
1 parent f02689a commit 2165298

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

docs/intro/firststeps.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Styling
230230
=======
231231

232232
Now that the Evaluation has been processed, we can add styling so that
233-
important information stands out in the final visualization. This is achived
233+
important information stands out in the final visualization. This is achieved
234234
through a special type of Processor called :ref:`topics-styles`.
235235

236236
Styles are also run in a processing pipeline, but they always output CSS strings.

docs/topics/evaluation.rst

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,30 @@ transform the evaluation one-at-a-time.
2121
Extracting the internal dataframe
2222
=================================
2323
Evaluations store the test results internally using a Pandas dataframe. You can
24-
retrive this dataframe by using the ``get_df()`` method.
24+
retrieve this dataframe by using the ``get_df()`` method. This can be used to
25+
manipulate the underlying data without needing to use the built-in FTPVL processors.
2526

26-
.. automethod:: ftpvl.evaluation.Evaluation.get_df
27+
.. note:: ``get_df()`` returns a defensive copy of the dataframe, so any
28+
mutations to the returned dataframe will not be reflected in the original
29+
Evaluation. Instead, you must instantiate a new ``Evaluation`` by passing
30+
in the dataframe and evaluation ID.
31+
32+
.. automethod:: ftpvl.evaluation.Evaluation.get_df
33+
34+
Example
35+
*******
36+
37+
.. code-block:: python
38+
39+
>>> eval1 = Evaluation(pd.DataFrame([{"a": 1, "b": 2}, {"a": 4, "b": 5}]), eval_id=1)
40+
>>> df = eval1.get_df() # extract Pandas dataframe
41+
>>> df
42+
a b
43+
0 1 2
44+
1 4 5
45+
>>> df["c"] = [3, 6] # add a new column
46+
>>> eval2 = Evaluation(df, eval_id=eval1.get_eval_id()) # create new evaluation
47+
>>> eval2.get_df()
48+
a b c
49+
0 1 2 3
50+
1 4 5 6

docs/topics/visualizers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can choose to show the version info of each test result by setting the
1616
the display of the version info that is provided by Hydra.
1717

1818

19-
Displaying the Visualizaton
19+
Displaying the Visualization
2020
============================
2121
After instantiating the desired visualizer, you can call the
2222
``get_visualization()`` method to return an object that can be displayed in an

0 commit comments

Comments
 (0)