Loading

matplotlib 度分布 画图

from matplotlib import pyplot as plt
%matplotlib inline
import os
import numpy as np
import pandas as pd

filename = 'xx'
df = pd.read_csv(os.path.join('data', filename), sep='\t', header=None)
df.columns = ['photo_id', 'q_cnt']
df_count = df.value_counts('q_cnt')

plt.figure(figsize=(15, 8))
plt.scatter(df_count.index, df_count.values)
plt.xscale('log')
plt.yscale('log')
plt.xlabel('qv')
plt.ylabel('count')
posted @ 2022-07-11 17:31  摇头晃脑学知识  阅读(27)  评论(0编辑  收藏  举报