import pandas as pd
import matplotlib.pyplot as plt
def csv_til_liste(filname):
occuDF = pd.read_csv(filname)
occuList=occuDF.values.tolist()
return occuDF, occuList
occuDF.boxplot(column = 'Temperature', by = 'Occupancy');
plt.suptitle('')
调用该方法并将其保存在两个单独的变量中:
df, l = csv_til_liste('a.csv')
df.boxplot(column = 'Temperature', by = 'Occupancy')
plt.suptitle('')