KOTA ITO

Generation

generate functionMon, 26 Dec 2022

X軸は10代、20代、30代、40代、50代、60代という、年齢です。Y軸は各年代における人気曲のランキングです。この折れ線グラフをスムーズな曲線にする。

# -*- coding: utf-8 -*- import pandas as pd import matplotlib.pyplot as plt import numpy as np df = pd.read_csv('data.csv') #df.set_index('date') #data = pd.read_csv('data.csv') #data.set_index('date') #plt.plot(data) #plt.plot(df) #plt.show() #画像を書き出す #fig = plt.figure() #fig.savefig('fig.png') #plt.show() #2枚のグラフを並べる #fig, ax1 = plt.subplots(2) #ax1[0].plot(df) #ax1[1].plot(df) #plt.show() #スムースにする #x = df.index #y = df['Ranking'] #plt.plot

Questions about programming?Chat with your personal AI assistant