Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
keeleliin
word_cloud_est
Commits
dd8747c7
Commit
dd8747c7
authored
Nov 04, 2012
by
Andreas Mueller
Browse files
woah that was unexpected
parent
aab23cd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
wordcloud.py
View file @
dd8747c7
...
...
@@ -45,8 +45,8 @@ def make_wordcloud(words, counts, width=400, height=200):
# recompute integral image
img_array
=
np
.
asarray
(
img
)
# recompute bottom right
partial_integral
=
np
.
cumsum
(
np
.
cumsum
(
img_array
[
x
:,
y
:],
axis
=
0
),
axis
=
1
)
partial_integral
=
np
.
cumsum
(
np
.
cumsum
(
img_array
[
x
:,
y
:],
axis
=
1
),
axis
=
0
)
# paste into old image
# if x or y is zero it is a bit annoying
if
x
>
0
:
...
...
@@ -71,4 +71,4 @@ if __name__ == "__main__":
words
=
np
.
array
(
cv
.
get_feature_names
())
words
=
words
[
counts
>
1
]
counts
=
counts
[
counts
>
1
]
make_wordcloud
(
words
,
counts
,
width
=
8
00
,
height
=
6
00
)
make_wordcloud
(
words
,
counts
,
width
=
4
00
,
height
=
3
00
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment