Skip to content

is_string_like returns True for numpy object arrays #7725

@fdtomasi

Description

@fdtomasi

Bug report

Bug summary

Function is_string_like returns True for numpy object arrays

Code for reproduction

import numpy as np
from matplotlib.cbook import is_string_like
print(is_string_like(np.array(map(str, [1,2,3]), dtype=object)))

Actual outcome

True

Expected outcome

False

The problem is that the line 707 obj + '' in is_string_like does not generate an exception with such numpy array.

Matplotlib version

  • Matplotlib version: 1.5.3
  • OS: Ubuntu 14.04
  • Python and Matplotlib Installed with Anaconda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy