Home > other >  Questions about the Python pyecharts (have been looking for information for half a day)
Questions about the Python pyecharts (have been looking for information for half a day)

Time:09-25

Name=[' A ', 'B', 'C', 'D', 'E']
Values=[1, 2, 3, 4, 5]
Wordcloud. Add (" ", the name, values, word_size_range=[20100], shape="circle")

The above program will be thrown
TypeError: add () takes 3 positional arguments but 4 positional arguments (and 2 keyword - only the arguments) were given

Don't can only use website for a list of nested tuple form? But I have seen similar I wrote,,,,
0.0

CodePudding user response:

You have to according to abnormal problems to deal with:
English is said:
The add () method only need three position parameters (will choose parameters), but you gave four position parameters and the two key words!

Check method is introduced:
 
WordCloud. The add () method signature
Add (name, attr, value,
Shape="circle",
Word_gap=20,
Word_size_range=None,
Rotate_step=45)
The name - & gt; STR: legend name
Attr - & gt; List: the attribute name
The value - & gt; List: attribute corresponds to the value of the
Shape - & gt; List: word cloud contour, 'circle', 'the cardioid', 'diamond', 'triangleforward', 'triangle', 'the pentagon', 'star' optional
Word_gap - & gt; Int: word spacing, the default is 20,
Word_size_range - & gt; List: word font size range, the default of [60] 12,,
Rotate_step - & gt; Int: rotating Angle of words, the default for 45


The following three parameters is position (with order, but also pay attention to whether the type of the incoming is consistent with the introduction of the
The name - & gt; STR: legend name
Attr - & gt; List: the attribute name
The value - & gt; List: attribute corresponds to the value of the

Three parameters before you right now?

CodePudding user response:

After I write the name and values is corresponding to the two parameters, are list (novice trouble correct, always can't find the reasons)

CodePudding user response:

Two parameters after and I tried to take out, so as not to quote two key parameters of the error, but there are 4 of the 3 | | -_ -

CodePudding user response:

 

The from pyecharts. Charts import WordCloud

Name=[' A ', 'B', 'C', 'D', 'E']
Values=[1, 2, 3, 4, 5]
Data=https://bbs.csdn.net/topics/zip (name, values)

Mywordcloud=WordCloud ()
Mywordcloud. Add (' data, shape='circle')
# # # rendered image
Mywordcloud. Render ()

CodePudding user response:

To:
 wordcloud. Add (" ", the name, values, word_size_range=[20100], shape="circle") 

The add function of wordcloud
To find the process, the following
Google search:
Pyecharts add
Find the
30 minutes to learn pyecharts data visualization - zhihu
Somebody else's writing is:
 cloud. The add (name='utils', attr=words, value=https://bbs.csdn.net/topics/counts, 
Shape="circle", word_size_range=(10; seven))

- "no you
Wordcloud. Add (" ", the name
The first, empty string: "

Find a website document
Documentation - pyecharts - en
Is:
"
WordCloud
Signatures WordCloud. The add ()
Attr
 add (name, value, shape="circle", word_gap=20, word_size_range=None, rotate_step=45) 

"
- "no more you write the first parameter to the empty string "
-> So the conclusion is clear:
Seems to be:
You pass a parameter, the first of the empty string ""
In fact is not, but:
Comparison website parameter order:
name, attr value , shape="circle", word_gap=20, word_size_range=None,...

And you are:
", "the name, values , word_size_range=[20100], shape=" circle "

Apparently (looks? :
You put the order of the parameters to make wrong?

(look) should be changed to:

wordcloud. Add ( name, "", values , word_size_range=[20100], shape=" circle ")

Note: I'm not sure your code logic, need your own clear to
name, attr value
What specific values,

So after:
- "don't refer to others (may be wrong, could be backward, not updated) code
- "or blind guess a (function parameters, and order)

In any case, should be:
- "to the correct ideas and methods of learning
- "core point is: to find the website formal information

Note:
1. Take time to take your situation, also organize to my upcoming tutorial
Python beginners small white common errors and problems

2. About how to master the correct study method and train of thought, as shown in the (forthcoming)
Learning method and technical experience summary




CodePudding user response:

reference 5 floor crifan reply:
to:
 wordcloud. Add (" ", the name, values, word_size_range=[20100], shape="circle") 

The add function of wordcloud
To find the process, the following
Google search:
Pyecharts add
Find the
30 minutes to learn pyecharts data visualization - zhihu
Somebody else's writing is:
 cloud. The add (name='utils', attr=words, value=https://bbs.csdn.net/topics/counts, 
Shape="circle", word_size_range=(10; seven))

- "no you
Wordcloud. Add (" ", the name
The first, empty string: "

Find a website document
Documentation - pyecharts - en
Is:
"
WordCloud
Signatures WordCloud. The add ()
Attr
 add (name, value, shape="circle", word_gap=20, word_size_range=None, rotate_step=45) 

"
- "no more you write the first parameter to the empty string "
-> So the conclusion is clear:
Seems to be:
You pass a parameter, the first of the empty string ""
In fact is not, but:
Comparison website parameter order:
name, attr value , shape="circle", word_gap=20, word_size_range=None,...

And you are:
", "the name, values , word_size_range=[20100], shape=" circle "

Apparently (looks? :
You put the order of the parameters to make wrong?

(look) should be changed to:

wordcloud. Add ( name, "", values , word_size_range=[20100], shape=" circle ")

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related