country name == 'Argentina'
データ全体から、対応する「値」に対してのみ線/散布図をプロットしたいと思います。
サンプルデータ
これは私のコードです
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_excel("C:/Users/kdandebo/Desktop/Models/Python excercise/Data3.xlsx")
x = (df['Country Name'])
#Although i have figured out x cannot be compared to a string named Argentina, i couldnt think of any other way, Also ive tried the below version too, but none works
#if (df['Country Name'] == 'Argentina'):
# y = (df['Value'])
for x == ("Argentina"):
y = (df['Value'])
plt.scatter(x,y)
plt.show()
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加