Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def countPred_eda(train_data, variableName, targetVariable):
- print(train_data[variableName].describe())
- return ggplot(train_data) +
- aes(targetVariable, variableName, fill = targetVariable) +
- geom_boxplot(alpha = .8) +
- labs(x = targetVariable, y = variableName) +
- ggtitle("Churn ratio with number_customer_service_calls ")
- countPred_eda(train_data, number_customer_service_calls,churn)
- count 3333.000000
- mean 1.562856
- std 1.315491
- min 0.000000
- 25% 1.000000
- 50% 1.000000
- 75% 2.000000
- max 9.000000
- Name: number_customer_service_calls, dtype: float64
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesIPythoncoreformatters.py in __call__(self, obj)
- 700 type_pprinters=self.type_printers,
- 701 deferred_pprinters=self.deferred_printers)
- --> 702 printer.pretty(obj)
- 703 printer.flush()
- 704 return stream.getvalue()
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesIPythonlibpretty.py in pretty(self, obj)
- 398 if cls is not object
- 399 and callable(cls.__dict__.get('__repr__')):
- --> 400 return _repr_pprint(obj, self, cycle)
- 401
- 402 return _default_pprint(obj, self, cycle)
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesIPythonlibpretty.py in _repr_pprint(obj, p, cycle)
- 693 """A pprint that just redirects to the normal repr function."""
- 694 # Find newlines and replace them with p.break_()
- --> 695 output = repr(obj)
- 696 for idx,output_line in enumerate(output.splitlines()):
- 697 if idx:
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineggplot.py in __repr__(self)
- 84 Print/show the plot
- 85 """
- ---> 86 self.draw()
- 87 plt.show()
- 88 return '<ggplot: (%d)>' % self.__hash__()
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineggplot.py in draw(self, return_ggplot)
- 201 if self.figure is not None:
- 202 plt.close(self.figure)
- --> 203 raise err
- 204
- 205 if return_ggplot:
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineggplot.py in draw(self, return_ggplot)
- 193 self._draw_facet_labels()
- 194 self._draw_labels()
- --> 195 self._draw_legend()
- 196 self._draw_title()
- 197 self._draw_watermarks()
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineggplot.py in _draw_legend(self)
- 396 Draw legend onto the figure
- 397 """
- --> 398 legend_box = self.guides.build(self)
- 399 if not legend_box:
- 400 return
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineguidesguides.py in build(self, plot)
- 133 self.spacing = 10
- 134
- --> 135 gdefs = self.train(plot)
- 136 if not gdefs:
- 137 return
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineguidesguides.py in train(self, plot)
- 203 # so Guides (i.e., the container of guides)
- 204 # need not to know about them
- --> 205 guide = guide.train(scale)
- 206
- 207 if guide is not None:
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotnineguidesguide_colorbar.py in train(self, scale)
- 76 # position of ticks
- 77 limits = scale.limits
- ---> 78 breaks = scale.get_breaks(strict=True)
- 79 breaks = np.asarray(breaks)
- 80 breaks = breaks[~np.isnan(breaks)]
- ~AppDataLocalcondacondaenvsggpy36libsite-packagesplotninescalesscale.py in get_breaks(self, limits, strict)
- 622 # minor breaks
- 623 if strict:
- --> 624 cond = (breaks >= limits[0]) & (limits[1] >= breaks)
- 625 breaks = np.compress(cond, breaks)
- 626 return np.asarray(breaks)
- TypeError: '>=' not supported between instances of 'list' and 'int
Add Comment
Please, Sign In to add comment