จำนวนบทความ | จำนวนคนตาม | |
---|---|---|
C | 2632 | 21745 |
C++ | 5919 | 24876 |
C# | 7428 | 23079 |
cobol | 56 | 45 |
Clojure | 619 | 550 |
CoffeeScript | 1016 | 11736 |
Delphi | 347 | 148 |
Elm | 452 | 463 |
Erlang | 524 | 446 |
Fortran | 255 | 196 |
golang | 2886 | 2025 |
Haskell | 1904 | 9497 |
Java | 12165 | 39527 |
JavaScript | 26385 | 59736 |
Julia | 570 | 620 |
Kotlin | 2576 | 2243 |
lisp | 267 | 358 |
Lua | 452 | 320 |
matlab | 369 | 360 |
Objective-C | 3946 | 17766 |
Pascal | 82 | 14 |
Perl | 1469 | 12189 |
PHP | 16170 | 37333 |
Prolog | 207 | 96 |
Python | 28671 | 55576 |
R | 2727 | 1912 |
Ruby | 21942 | 34068 |
Rust | 1298 | 1527 |
Scala | 2830 | 10363 |
Swift | 11791 | 6603 |
TypeScript | 3037 | 2325 |
VB.Net | 359 | 322 |
import requests
import matplotlib.pyplot as plt
import pandas as pd
lis_tagid = '''c c++ csharp cobol clojure coffeescript delphi elm
erlang fortran golang haskell java javascript julia
kotlin lisp lua matlab objective-c pascal perl php prolog
python r ruby rust scala swift typescript vb.net
'''.split()
phasa = []
n_follow = []
n_item = []
for tagid in lis_tagid:
r = requests.get('https://qiita.com/api/v2/tags/'+tagid)
r.raise_for_status()
khomun = r.json()
phasa.append(khomun['id'])
n_follow.append(khomun['followers_count'])
n_item.append(khomun['items_count'])
df = pd.DataFrame(index=phasa)
df['จำนวนบทความ'] = n_item
df['จำนวนคนตาม'] = n_follow
print(df)
y = range(len(phasa))
plt.figure(figsize=[6,6])
plt.axes(ylim=[min(y)-0.5,max(y)+0.5])
df.sort_values('จำนวนคนตาม',inplace=True)
plt.yticks(y,['%s: %6s'%x for x in df['จำนวนคนตาม'].iteritems()])
plt.barh(y,df['จำนวนคนตาม'],color='#882244')
plt.title(u'จำนวนคนตามอ่าน',family='Tahoma')
plt.tight_layout()
plt.figure(figsize=[6,6])
plt.axes(ylim=[min(y)-0.5,max(y)+0.5])
df.sort_values('จำนวนบทความ',inplace=True)
plt.yticks(y,['%s: %6s'%x for x in df['จำนวนบทความ'].iteritems()])
plt.barh(y,df['จำนวนบทความ'],color='#337744')
plt.title(u'จำนวนบทความ',family='Tahoma')
plt.tight_layout()
plt.show()
require "open-uri"
require "json"
require "csv"
phasa = %w!c c++ csharp cobol clojure coffeescript delphi elm
erlang fortran golang haskell java javascript julia
kotlin lisp lua matlab objective-c pascal perl php prolog
python r ruby rust scala swift typescript vb.net!
col = %w!id items_count followers_count!
CSV.open('phasanaiqiita.csv','w'){|csv|
phasa.each{|p|
data = JSON.parse(open('https://qiita.com/api/v2/tags/'+p).read)
csv << col.map{|c|data[c]}
}
}
ติดตามอัปเดตของบล็อกได้ที่แฟนเพจ