Python Forum
How many unique values of quality are in this dataset? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How many unique values of quality are in this dataset? (/thread-10428.html)



How many unique values of quality are in this dataset? - Jack_Sparrow - May-20-2018

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?


RE: How many unique values of quality are in this dataset? - volcano63 - May-20-2018

(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?