Skip to content

Commit eb6ebdd

Browse files
authored
Merge pull request #139 from LibraryCarpentry/pandas_bug
add pandas bug note
2 parents ec036ef + 61b5831 commit eb6ebdd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

episodes/data-visualisation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ df_long.head()
4747

4848
Ok! We are now ready to plot our data. Since this data is monthly data, we can plot the circulation data over time.
4949

50+
::::::::::::::::::::::::::::::::::::: instructor
51+
## Instructor note: Pandas 2.2.* bug
52+
There is a bug in the latest release of Pandas that is causing certain plots to display in a garbled manner. This is a [known issue](https://github.com/pandas-dev/pandas/issues/59960) that the Pandas team plans to address. In the meantime, learners and instructors can user older versions of pandas *or* add `.sort_index()` before any instance of `.plot()`. For example, use `albany['circulation'].sort_index().plot()` instead of `albany['circulation'].plot()`.
53+
:::::::::::::::::::::::::::::::::::::::::::::::::
54+
5055
At first, let’s focus on a specific branch. We can select the rows for the Albany Park branch:
5156

5257
``` python
@@ -66,6 +71,7 @@ albany.head()
6671
| 2014-01-01 | Albany Park | 5150 N. Kimball Ave. | Chicago | 60625.0 | 50484 | 2014 | january | 35 |
6772
| 2015-01-01 | Albany Park | NaN | NaN | NaN | 133366 | 2015 | january | 10889 |
6873

74+
6975
Now we can use the `plot()` function that is built in to pandas. Let’s try it:
7076

7177
``` python

0 commit comments

Comments
 (0)