Python Forum

Full Version: How many unique values of quality are in this dataset?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there, I got stuck on this problem:

I need to answer this question: How many unique values of quality are in this dataset?

I tried out to answer this question with this function:
import pandas as pd
import numpy as np
% matplotlib inline

df = pd.read_csv(r'C:\Users\DSule\Desktop\python\winequality-red.csv', sep =';')
res = pd.df['quality'].nunique()
and get this error
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-52-d254f858d008> in <module>()
----> 1 res = pd.df['quality'].nunique()

AttributeError: module 'pandas' has no attribute 'df'
Can somebody help?
(May-20-2018, 01:23 PM)Jack_Sparrow Wrote: [ -> ]
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-52-d254f858d008> in <module>()
----> 1 res = pd.df['quality'].nunique()

AttributeError: module 'pandas' has no attribute 'df'
Can somebody help?

Well, it does not Doh . Read your code again - why pd.df?