# Python Medical Data Visualizer - Feedback + help with weird errors

**URL:** <https://forum.freecodecamp.org/t/python-medical-data-visualizer-feedback-help-with-weird-errors/455979>\
**Category:** I Built This\
**Created:** [April 15, 2021, 12:40pm UTC](https://forum.freecodecamp.org/t/python-medical-data-visualizer-feedback-help-with-weird-errors/455979 "2021-04-15T12:40:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snjegu](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@snjegu](https://forum.freecodecamp.org/u/snjegu)\
**Post date:** [April 15, 2021, 12:40pm UTC](https://forum.freecodecamp.org/t/python-medical-data-visualizer-feedback-help-with-weird-errors/455979/1 "2021-04-15T12:40:31Z")

</div>

Hi everyone!

I just finished with the python medical data visualizer project (I think!). The figure I get seems to match the one that was provided, but it still gives me some weird errors.

Here’s the link:  
[Project](https://replit.com/@snjegu/boilerplate-medical-data-visualizer-2)

Any feedback is very much appreciated!

Thanks,  
Marcus

---

<div class="post-metadata">

**Author:** ![helmut.roschy](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/helmut.roschy/32/134702_2.png) [@helmut.roschy](https://forum.freecodecamp.org/u/helmut.roschy)\
**Post date:** [April 15, 2021, 9:33pm UTC](https://forum.freecodecamp.org/t/python-medical-data-visualizer-feedback-help-with-weird-errors/455979/2 "2021-04-15T21:33:28Z")

</div>

Hi snjegu,

same error occurred to me, but I was able to resolve it in the following way:

Instead of producing the figure like you did in your code:

```auto
fig = sns.catplot(data=df_cat, col='cardio',kind='count',hue='value',x='variable',order=('active','alco','cholesterol','gluc','overweight','smoke'))

```

you should instead do it the following way:

```auto
g = sns.catplot(data=df_cat, col='cardio',kind='count',hue='value',x='variable',order=('active','alco','cholesterol','gluc','overweight','smoke'))
g.set_axis_labels("variable", "total")
fig = g.fig

```

The theory behind the code is that sns.catplot() returns a FacetGrid-Object which itself doesn’t have any children (it seems to be an nd-array like the error message says), but it has an attribute (namely the .fig see the last line), which is a Figure-Object, so at last all the tests should pass.

Good luck,

Helmut

---

<div class="post-metadata">

**Author:** ![snjegu](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@snjegu](https://forum.freecodecamp.org/u/snjegu)\
**Post date:** [April 16, 2021, 1:48pm UTC](https://forum.freecodecamp.org/t/python-medical-data-visualizer-feedback-help-with-weird-errors/455979/3 "2021-04-16T13:48:26Z")

</div>

Thanks Helmut, I will look into it!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [October 16, 2021, 1:48am UTC](https://forum.freecodecamp.org/t/python-medical-data-visualizer-feedback-help-with-weird-errors/455979/4 "2021-10-16T01:48:30Z")

</div>

Closed on October 16, 2021, 1:48am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
