Code Monkey home page Code Monkey logo

Comments (3)

stevedodson avatar stevedodson commented on May 13, 2024

Resolved by #117

from eland.

stevedodson avatar stevedodson commented on May 13, 2024

Still an issue with histograms and categorical columns:

feature='international plan'

df[df.churn==0][feature].hist(density=True, alpha=0.5)
df[df.churn==1][feature].hist(density=True, alpha=0.5)
plt.show()

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-13-7bbc4512e82d> in <module>
      1 feature='international plan'
      2 
----> 3 df[df.churn==0][feature].hist(density=True, alpha=0.5)
      4 df[df.churn==1][feature].hist(density=True, alpha=0.5)
      5 plt.show()

~/PycharmProjects/eland/eland/plotting/_core.py in ed_hist_series(self, by, ax, grid, xlabelsize, xrot, ylabelsize, yrot, figsize, bins, **kwds)
     57         figsize=figsize,
     58         bins=bins,
---> 59         **kwds
     60     )
     61 

~/PycharmProjects/eland/eland/plotting/_matplotlib/hist.py in hist_series(self, by, ax, grid, xlabelsize, xrot, ylabelsize, yrot, figsize, bins, **kwds)
     56         self_weights = self_weights.squeeze()
     57 
---> 58         ax.hist(self_bins[:-1], bins=self_bins, weights=self_weights, **kwds)
     59         ax.grid(grid)
     60         axes = np.array([ax])

~/anaconda3/envs/eland/lib/python3.7/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
   1599     def inner(ax, *args, data=None, **kwargs):
   1600         if data is None:
-> 1601             return func(ax, *map(sanitize_sequence, args), **kwargs)
   1602 
   1603         bound = new_sig.bind(ax, *args, **kwargs)

~/anaconda3/envs/eland/lib/python3.7/site-packages/matplotlib/axes/_axes.py in hist(self, x, bins, range, density, weights, cumulative, bottom, histtype, align, orientation, rwidth, log, color, label, stacked, normed, **kwargs)
   6765             # this will automatically overwrite bins,
   6766             # so that each histogram uses the same bins
-> 6767             m, bins = np.histogram(x[i], bins, weights=w[i], **hist_kwargs)
   6768             m = m.astype(float)  # causes problems later if it's an int
   6769             if mlast is None:

<__array_function__ internals> in histogram(*args, **kwargs)

~/anaconda3/envs/eland/lib/python3.7/site-packages/numpy/lib/histograms.py in histogram(a, bins, range, normed, weights, density)
    793     a, weights = _ravel_and_check_weights(a, weights)
    794 
--> 795     bin_edges, uniform_bins = _get_bin_edges(a, bins, range, weights)
    796 
    797     # Histogram is an integer or a float array depending on the weights.

~/anaconda3/envs/eland/lib/python3.7/site-packages/numpy/lib/histograms.py in _get_bin_edges(a, bins, range, weights)
    436 
    437     else:
--> 438         raise ValueError('`bins` must be 1d, when an array')
    439 
    440     if n_equal_bins is not None:

ValueError: `bins` must be 1d, when an array

from eland.

V1NAY8 avatar V1NAY8 commented on May 13, 2024

@sethmlarson / @stevedodson Can you please summarize on what exactly the issue is? 😃

from eland.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.