Git Product home page Git Product logo

crypto-discovery-news-sentiment-analysis's Issues

Error in Visualizing the Data notebook cell

After following the steps in the readme, I am getting the below error when I run the "Visualizing the Data" cell of the notebook.

ValueError                                Traceback (most recent call last)
<ipython-input-11-c6770b433353> in <module>()
      8                                     pctdistance=0.85,
      9                                     autopct='%1.1f%%',
---> 10                                     title='Sentiment of articles reporting on Bitcoin')
     11 
     12 # center_circle = plt.Circle((0,0),0.70,fc='white')

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/pandas/plotting/_core.py in __call__(self, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)
   2497                            colormap=colormap, table=table, yerr=yerr,
   2498                            xerr=xerr, label=label, secondary_y=secondary_y,
-> 2499                            **kwds)
   2500     __call__.__doc__ = plot_series.__doc__
   2501 

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/pandas/plotting/_core.py in plot_series(data, kind, ax, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, label, secondary_y, **kwds)
   1923                  yerr=yerr, xerr=xerr,
   1924                  label=label, secondary_y=secondary_y,
-> 1925                  **kwds)
   1926 
   1927 

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/pandas/plotting/_core.py in _plot(data, x, y, subplots, ax, kind, **kwds)
   1725         plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
   1726 
-> 1727     plot_obj.generate()
   1728     plot_obj.draw()
   1729     return plot_obj.result

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/pandas/plotting/_core.py in generate(self)
    252         self._compute_plot_data()
    253         self._setup_subplots()
--> 254         self._make_plot()
    255         self._add_table()
    256         self._make_legend()

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/pandas/plotting/_core.py in _make_plot(self)
   1479             else:
   1480                 blabels = None
-> 1481             results = ax.pie(y, labels=blabels, **kwds)
   1482 
   1483             if kwds.get('autopct', None) is not None:

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/matplotlib/__init__.py in inner(ax, *args, **kwargs)
   1708                     warnings.warn(msg % (label_namer, func.__name__),
   1709                                   RuntimeWarning, stacklevel=2)
-> 1710             return func(ax, *args, **kwargs)
   1711         pre_doc = inner.__doc__
   1712         if pre_doc is None:

/opt/conda/envs/DSX-Python35/lib/python3.5/site-packages/matplotlib/axes/_axes.py in pie(self, x, explode, labels, colors, autopct, pctdistance, shadow, labeldistance, startangle, radius, counterclock, wedgeprops, textprops, center, frame, rotatelabels)
   2635             raise ValueError("'label' must be of length 'x'")
   2636         if len(x) != len(explode):
-> 2637             raise ValueError("'explode' must be of length 'x'")
   2638         if colors is None:
   2639             get_next_color = self._get_patches_for_fill.get_next_color

ValueError: 'explode' must be of length 'x'```

Cell value for reference, which I have not changed.
```import matplotlib.pyplot as plt
plt.style.use('fivethirtyeight')

df['sentiment_label'].value_counts().plot(kind='pie', 
                                    subplots=False, 
                                    explode=(0.05, 0.05, 0.05), 
                                    startangle=100,
                                    pctdistance=0.85,
                                    autopct='%1.1f%%',
                                    title='Sentiment of articles reporting on Bitcoin')

# center_circle = plt.Circle((0,0),0.70,fc='white')
# fig = plt.gcf()
# fig.gca().add_artist(center_circle)

plt.tight_layout()
plt.show()```

Returning empty results

Hi, I am running the code as it was written but the results is empty. Do I have to update something?

Credentials for Discovery Service Change

It seems the discovery service wants JSON for credentials and not a user/pass. Can you help me resolve this?

from the discovery service credentials page:

Credentials are provided in JSON format. The JSON snippet lists credentials, such as the API key and secret, as well as connection information for the service.

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.