Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김건
/
Comment_Analysis
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김건
2019-11-22 06:31:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2cf41d50799cdd3e4becc244f7e5075e82cc834
c2cf41d5
1 parent
5f685fbb
5차 구현 사항
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
3 deletions
Youtube/main.py
Youtube/requirements.txt
youtube.md
Youtube/main.py
View file @
c2cf41d
...
...
@@ -2,6 +2,9 @@ import downloader
from
time
import
sleep
from
konlpy.tag
import
Twitter
from
collections
import
Counter
from
matplotlib
import
rc
import
matplotlib.pyplot
as
plt
from
matplotlib
import
font_manager
as
fm
import
pytagcloud
import
operator
def
get_tags
(
Comment_List
)
:
...
...
@@ -110,9 +113,53 @@ def make_time_chart (Comment_List) :
day_data
=
sorted
(
day_dict
.
items
(),
key
=
operator
.
itemgetter
(
0
))
hour_data
=
sorted
(
hour_dict
.
items
(),
key
=
operator
.
itemgetter
(
0
))
minute_data
=
sorted
(
minute_dict
.
items
(),
key
=
operator
.
itemgetter
(
0
))
print
(
month_data
)
print
(
week_data
)
print
(
day_data
)
#print(month_data)
#print(week_data)
#print(day_data)
make_chart
(
year_data
,
month_data
,
week_data
,
day_data
,
hour_data
,
minute_data
)
def
make_chart
(
year_data
,
month_data
,
week_data
,
day_data
,
hour_data
,
minute_data
)
:
temp_list
=
[
year_data
,
month_data
,
week_data
,
day_data
,
hour_data
,
minute_data
]
x_list
=
[]
y_list
=
[]
print
(
temp_list
)
for
var1
in
temp_list
:
for
var2
in
var1
:
if
(
var2
[
0
]
.
find
(
'년'
)
>=
0
):
temp1
=
var2
[
0
][
0
]
+
'years'
temp2
=
int
(
var2
[
1
])
x_list
.
append
(
temp1
)
y_list
.
append
(
temp2
)
elif
(
var2
[
0
]
.
find
(
'개월'
)
>=
0
):
temp1
=
var2
[
0
][
0
]
+
'months'
temp2
=
int
(
var2
[
1
])
x_list
.
append
(
temp1
)
y_list
.
append
(
temp2
)
elif
(
var2
[
0
]
.
find
(
'주'
)
>=
0
):
temp1
=
var2
[
0
][
0
]
+
'weeks'
temp2
=
int
(
var2
[
1
])
x_list
.
append
(
temp1
)
y_list
.
append
(
temp2
)
elif
(
var2
[
0
]
.
find
(
'일'
)
>=
0
):
temp1
=
var2
[
0
][
0
]
+
'days'
temp2
=
int
(
var2
[
1
])
x_list
.
append
(
temp1
)
y_list
.
append
(
temp2
)
elif
(
var2
[
0
]
.
find
(
'시간'
)
>=
0
):
temp1
=
var2
[
0
][
0
]
+
'hours'
temp2
=
int
(
var2
[
1
])
x_list
.
append
(
temp1
)
y_list
.
append
(
temp2
)
else
:
temp1
=
var2
[
0
][
0
]
+
'minutes'
temp2
=
int
(
var2
[
1
])
x_list
.
append
(
temp1
)
y_list
.
append
(
temp2
)
print
(
x_list
)
plt
.
bar
(
x_list
,
y_list
,
width
=
0.5
,
color
=
"blue"
)
# plt.show() -> 출력
plt
.
savefig
(
'chart.png'
,
dpi
=
300
)
# plt.savefig('chart.png', dpi=300)
def
call_main
():
print
(
' Comment Thread 생성중
\n
'
)
...
...
Youtube/requirements.txt
View file @
c2cf41d
...
...
@@ -8,3 +8,4 @@ pytagcloud
### wordcloud
Jpye1
### Ű м
python -m pip install -U matplotlib==3.2.0rc1
...
...
youtube.md
View file @
c2cf41d
...
...
@@ -46,3 +46,7 @@ Youtube 3차 수정 사항
1.
시간대 별로 sort된 리스트를 matplotlib python을 이용하여 차트화 시키기
2. 기능 별로 접근할 수 있도록 정리할 것
-----------------------------------------------------
5차 개발사항
1.
시간대 별로 sort된 리스트를 matplotlib for python을 이용하여 차트화 하였음
\ No newline at end of file
...
...
Please
register
or
login
to post a comment