import warnings
import numpy as np
+from numpy.testing import assert_array_almost_equal_nulp
import pytest
import pandas.util._test_decorators as td
# no subplots
df = DataFrame({"A": [3] * 5, "B": list(range(1, 6))}, index=range(5))
ax = df.plot.bar(grid=True, log=True)
- tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected)
+ assert_array_almost_equal_nulp(ax.yaxis.get_ticklocs(), expected, 4)
def test_bar_log_subplots(self):
expected = np.array([0.1, 1.0, 10.0, 100.0, 1000.0, 1e4])
log=True, subplots=True
)
- tm.assert_numpy_array_equal(ax[0].yaxis.get_ticklocs(), expected)
- tm.assert_numpy_array_equal(ax[1].yaxis.get_ticklocs(), expected)
+ assert_array_almost_equal_nulp(ax[0].yaxis.get_ticklocs(), expected, 4)
+ assert_array_almost_equal_nulp(ax[1].yaxis.get_ticklocs(), expected, 4)
def test_boxplot_subplots_return_type(self, hist_df):
df = hist_df
from itertools import chain
import numpy as np
+from numpy.testing import assert_array_almost_equal_nulp
import pytest
import pandas.util._test_decorators as td
_, ax = self.plt.subplots()
ax = Series([200, 500]).plot.bar(log=True, ax=ax)
- tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected)
+ assert_array_almost_equal_nulp(ax.yaxis.get_ticklocs(), expected, 4)
tm.close()
_, ax = self.plt.subplots()
ax = Series([200, 500]).plot.barh(log=True, ax=ax)
- tm.assert_numpy_array_equal(ax.xaxis.get_ticklocs(), expected)
+ assert_array_almost_equal_nulp(ax.xaxis.get_ticklocs(), expected, 4)
tm.close()
# GH 9905
res = ax.get_ylim()
tm.assert_almost_equal(res[0], ymin)
tm.assert_almost_equal(res[1], ymax)
- tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected)
+ assert_array_almost_equal_nulp(ax.yaxis.get_ticklocs(), expected, 4)
tm.close()
_, ax = self.plt.subplots()
res = ax.get_xlim()
tm.assert_almost_equal(res[0], ymin)
tm.assert_almost_equal(res[1], ymax)
- tm.assert_numpy_array_equal(ax.xaxis.get_ticklocs(), expected)
+ assert_array_almost_equal_nulp(ax.xaxis.get_ticklocs(), expected, 4)
def test_bar_ignore_index(self):
df = Series([1, 2, 3, 4], index=["a", "b", "c", "d"])