8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ce11f2 commit 79b9ee0Copy full SHA for 79b9ee0
lib/matplotlib/category.py
@@ -14,23 +14,8 @@
14
import matplotlib.ticker as ticker
15
16
17
-# pure hack for numpy 1.6 support
18
-from distutils.version import LooseVersion
19
-
20
-NP_NEW = (LooseVersion(np.version.version) >= LooseVersion('1.7'))
21
22
23
def to_array(data, maxlen=100):
24
- if NP_NEW:
25
- return np.array(data, dtype=np.unicode)
26
- if cbook.is_scalar_or_string(data):
27
- data = [data]
28
- try:
29
- vals = np.array(data, dtype=('|S', maxlen))
30
- except UnicodeEncodeError:
31
- # this yields gibberish
32
- vals = np.array([convert_to_string(d) for d in data])
33
- return vals
+ return np.array(data, dtype=np.unicode)
34
35
36
class StrCategoryConverter(units.ConversionInterface):
0 commit comments