しょっちゅう忘れることを書いておく。
![]() |
66 |
386 views
- # coding: UTF-8
- import pandas as pd
- import matplotlib.pyplot as plt
- import seaborn as sns
- def main():
- df = pd.read_csv("./data/train_data.csv")
- df = df[df['year'] == 2019]
- print(df)
- sns.histplot(df['cover'].values)
- plt.show()
- if __name__ == '__main__':
- main()
drop_duplicates関数を使うことがポイント。
- # coding: UTF-8
- import pandas as pd
- import matplotlib.pyplot as plt
- import seaborn as sns
- def main():
- df = pd.read_csv("./data/train_data.csv")
- df_year = df.drop_duplicates(subset='year')
- print(df_year['year'].values)
- for year in df_year['year'].values:
- dy = df[df['year'] == year]
- sns.histplot(dy['cover'].values)
- plt.show()
- if __name__ == '__main__':
- main()
Page 53 of 69.
すぺぺぺ
本サイトの作成者。
プログラムは趣味と勉強を兼ねて、のんびり本サイトを作っています。
フレームワークはdjango。
ChatGPTで自動プログラム作成に取り組み中。
https://www.osumoi-stdio.com/novel/