import pandas as pd
#初始化
x=0
y=0
z=0
k=0
#读文件
data = pd.read_csv(r'train_label.csv')
length = len(data)
#获取文件特定列
data1 = data['label_y'] #获取名字为label_y列的数据
#查看文件
print(data)
print(data1)
length1 = len(data1)
#计算特定列的数值分布
for i in range(length):
if data1[i] == 0:
x = x+1
elif data1[i] == 1:
y=y+1
elif data1[i] == 2:
z=z+1
elif data1[i] == 3:
k=k+1
print(x,y,z,k)