Skip to content

Commit 06c2d5b

Browse files
committed
CLN: cleaned up numeric dtype tests in tools/plotting.py
1 parent f75200f commit 06c2d5b

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

pandas/tools/plotting.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -932,21 +932,7 @@ def _get_layout(self):
932932
return (len(self.data.columns), 1)
933933

934934
def _compute_plot_data(self):
935-
try:
936-
# might be an ndframe
937-
numeric_data = self.data._get_numeric_data()
938-
except AttributeError: # TODO: rm in 0.13 (series-inherit-ndframe)
939-
numeric_data = self.data
940-
orig_dtype = numeric_data.dtype
941-
942-
# possible object array of numeric data
943-
if orig_dtype == np.object_:
944-
numeric_data = numeric_data.convert_objects() # soft convert
945-
946-
# still an object dtype so we can't plot it
947-
if numeric_data.dtype == np.object_:
948-
raise TypeError('Series has object dtype and cannot be'
949-
' converted: no numeric data to plot')
935+
numeric_data = self.data.convert_objects()._get_numeric_data()
950936

951937
try:
952938
is_empty = numeric_data.empty

0 commit comments

Comments
 (0)