Skip to content

Missing support numpy.ndarray in st.map #5835

@sfc-gh-kbregula

Description

@sfc-gh-kbregula

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

According to the documentation, st.map accepts numpy.ndarray.
Screenshot 2022-12-08 at 23 18 17
https://docs.streamlit.io/library/api-reference/charts/st.map
But I checked and it doesn't work.

Reproducible Code Example

arr = np.array([[1, 2], [4, 5]], np.int32)
st.map(arr)

Steps To Reproduce

No response

Expected Behavior

We have two solutions:

  1. Update the docstring and drop support for numpy.ndarray in st.map
  2. Add support for Nx2 arrays.

Current Behavior

Error message:

streamlit.errors.StreamlitAPIException: Map data must contain a latitude column named: 'LAT', 'LATITUDE', 'lat', 'latitude'. Existing columns: 0, 1

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: develop
  • Python version: N/A
  • Operating System: N/A
  • Browser: N/A
  • Virtual environment: N/A

Additional Information

Previous discussion: #5792 (comment)

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:st.mapRelated to the `st.map` elementpriority:P2Medium-high priority - fix within one monthstatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions