Git Product home page Git Product logo

Comments (5)

rightevil avatar rightevil commented on May 28, 2024 1

thanks, it was wonderful project i will star it!

from wechatvisualization.

Jasmine969 avatar Jasmine969 commented on May 28, 2024

Seems to be the matplotlib import error. Check whether you could import matplotlib in the terminal with the following command:

from matplotlib import pyplot as plt

from wechatvisualization.

rightevil avatar rightevil commented on May 28, 2024
>PYTHON
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib import pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\py\lib\site-packages\matplotlib\pyplot.py", line 2230, in <module>
    switch_backend(rcParams["backend"])
  File "D:\py\lib\site-packages\matplotlib\__init__.py", line 672, in __getitem__
    plt.switch_backend(rcsetup._auto_backend_sentinel)
  File "D:\py\lib\site-packages\matplotlib\pyplot.py", line 247, in switch_backend
    switch_backend(candidate)
  File "D:\py\lib\site-packages\matplotlib\pyplot.py", line 267, in switch_backend
    class backend_mod(matplotlib.backend_bases._Backend):
  File "D:\py\lib\site-packages\matplotlib\pyplot.py", line 268, in backend_mod
    locals().update(vars(importlib.import_module(backend_name)))
  File "D:\py\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "D:\py\lib\site-packages\matplotlib\backends\backend_qtagg.py", line 12, in <module>
    from .backend_qt import (
  File "D:\py\lib\site-packages\matplotlib\backends\backend_qt.py", line 73, in <module>
    _MODIFIER_KEYS = [
  File "D:\py\lib\site-packages\matplotlib\backends\backend_qt.py", line 74, in <listcomp>
    (_to_int(getattr(_enum("QtCore.Qt.KeyboardModifier"), mod)),
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'KeyboardModifier'

it seems have the same error

from wechatvisualization.

Jasmine969 avatar Jasmine969 commented on May 28, 2024

It is not the WeChatVisualization bug.
You should install matplotlib properly.
Try converting to Python 3.7/3.8 and matplotlib 3.4.2 as stated in requirements.txt.

from wechatvisualization.

rightevil avatar rightevil commented on May 28, 2024

It is not the WeChatVisualization bug. You should install matplotlib properly. Try converting to Python 3.7/3.8 and matplotlib 3.4.2 as stated in requirements.txt.

should i change the top_k?

>python main.py
开始分词
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\30969\AppData\Local\Temp\jieba.cache
Loading model cost 0.413 seconds.
Prefix dict has been built successfully.
  0%|                                                                                            | 0/3 [00:00<?, ?it/s]F:\wechat_visulization\WechatVisualization-master\WechatVisualization-master\parse.py:73: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '[, 呲, 牙, ]' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  records.loc[i, 'keywords'] = ', '.join(result)
F:\wechat_visulization\WechatVisualization-master\WechatVisualization-master\parse.py:74: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value '' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
  records.loc[i, 'emoji'] = ', '.join(emoji_res)
100%|███████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 632.18it/s]
F:\wechat_visulization\WechatVisualization-master\WechatVisualization-master\parse.py:82: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
  records.replace('', float('nan'), inplace=True)  # 方便后面dropna
====================
计算词频并制作词云
====================
计算word_specificity
word_min_count应不超过1
top_k应不超过0
Traceback (most recent call last):
  File "F:\wechat_visulization\WechatVisualization-master\WechatVisualization-master\main.py", line 41, in <module>
    main(
  File "F:\wechat_visulization\WechatVisualization-master\WechatVisualization-master\main.py", line 30, in main
    word_specificity(name1, name2, **p_word_specificity)
  File "F:\wechat_visulization\WechatVisualization-master\WechatVisualization-master\word_specificity.py", line 25, in word_specificity
    plt.barh(y, all_df.iloc[:top_k, 3], color='C1')
  File "D:\py\lib\site-packages\matplotlib\pyplot.py", line 2783, in barh
    return gca().barh(
  File "D:\py\lib\site-packages\matplotlib\axes\_axes.py", line 2701, in barh
    patches = self.bar(x=left, height=height, width=width, bottom=y,
  File "D:\py\lib\site-packages\matplotlib\__init__.py", line 1478, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "D:\py\lib\site-packages\matplotlib\axes\_axes.py", line 2461, in bar
    x, height, width, y, linewidth, hatch = np.broadcast_arrays(
  File "D:\py\lib\site-packages\numpy\lib\stride_tricks.py", line 540, in broadcast_arrays
    shape = _broadcast_shape(*args)
  File "D:\py\lib\site-packages\numpy\lib\stride_tricks.py", line 422, in _broadcast_shape
    b = np.broadcast(*args[:32])
ValueError: shape mismatch: objects cannot be broadcast to a single shape.  Mismatch is between arg 2 with shape (0,) and arg 3 with shape (25,).

from wechatvisualization.

Related Issues (6)

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.