Open ceo21ckim opened 10 months ago
EDA / Histogram
def plot_hist(li: list, bins=50, title=None, xlabel=None, ylabel=None, f_name='figure.png', save=False) -> None:
sns.histplot(li, bins=bins, kde=True)
plt.title(title); plt.xlabel(xlabel); plt.ylabel(ylabel)
if save:
plt.savefig(os.path.join(FIG_DIR, f'{f_name}'), dpi=200)
plt.show()
plot_hist(length, title='Sentence Length', xlabel='length', ylabel='count', f_name='sentence_length_histogram.png', save=True)
Max Length를 확인하는 코드 공유합니다.