# Interpreting profile data in ping-python

**URL:** <https://discuss.bluerobotics.com/t/interpreting-profile-data-in-ping-python/17272>\
**Category:** Ping Sonar Devices\
**Created:** [June 26, 2024, 2:56pm UTC](https://discuss.bluerobotics.com/t/interpreting-profile-data-in-ping-python/17272 "2024-06-26T14:56:37Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [July 1, 2024, 6:40pm UTC](https://discuss.bluerobotics.com/t/interpreting-profile-data-in-ping-python/17272/8 "2024-07-01T18:40:29Z")

</div>

> [@MJS\_FRF](#):
>
> I had seen another topic on the forum use my original solution without being corrected.

Unfortunately not every mistake gets noticed on the first pass.

I did happen to find [this post](https://discuss.bluerobotics.com/t/ping-1d-profile-data-understanding/12775) while looking around, which seems to have used the same approach as your original one (so might be what you’re referring to), but the question being asked wasn’t focused on the presented code or perceived errors in the data, so I’m not too surprised that the code issue got missed at the time.

Fair enough that that’s confusing though - incorrect references always make things more complicated than they need to be, and ideally we’d have an example of processing and doing something with the data included with the library, since that’s a reasonably basic usage of it, but that’s not something we’ve made at this stage.

> [@MJS\_FRF](#):
>
> One thing I want to note for the 3rd solution is that I am receiving a keyError for the ‘profile\_data\_length’ field.

My bad - that [looks to be missing in the library](https://github.com/bluerobotics/ping-python/blob/deployment/brping/ping1d.py#L232-L259), so there might be an issue with the generator, or how it’s defined in the protocol. That said, it might also be intentional because in Python the profile data container has a queryable length (using the `len` builtin).

Either way, I’ve updated the example snippet to use `len` instead 🙂

---

_[View the full topic](https://discuss.bluerobotics.com/t/interpreting-profile-data-in-ping-python/17272)._
