Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- <ipython-input-1-10a5f5b12254> in <module>()
- 20 print("Database connection is closed now ")
- 21 df.columns = fields
- ---> 22 df.describe(include='all')
- /usr/lib/python3.6/site-packages/pandas/core/generic.py in describe(self, percentiles, include, exclude)
- 8568 data = self.select_dtypes(include=include, exclude=exclude)
- 8569
- -> 8570 ldesc = [describe_1d(s) for _, s in data.iteritems()]
- 8571 # set a convenient order for rows
- 8572 names = []
- /usr/lib/python3.6/site-packages/pandas/core/generic.py in <listcomp>(.0)
- 8568 data = self.select_dtypes(include=include, exclude=exclude)
- 8569
- -> 8570 ldesc = [describe_1d(s) for _, s in data.iteritems()]
- 8571 # set a convenient order for rows
- 8572 names = []
- /usr/lib/python3.6/site-packages/pandas/core/generic.py in describe_1d(data)
- 8551 return describe_numeric_1d(data)
- 8552 else:
- -> 8553 return describe_categorical_1d(data)
- 8554
- 8555 if self.ndim == 1:
- /usr/lib/python3.6/site-packages/pandas/core/generic.py in describe_categorical_1d(data)
- 8525 def describe_categorical_1d(data):
- 8526 names = ['count', 'unique']
- -> 8527 objcounts = data.value_counts()
- 8528 count_unique = len(objcounts[objcounts != 0])
- 8529 result = [data.count(), count_unique]
- /usr/lib/python3.6/site-packages/pandas/core/base.py in value_counts(self, normalize, sort, ascending, bins, dropna)
- 1036 from pandas.core.algorithms import value_counts
- 1037 result = value_counts(self, sort=sort, ascending=ascending,
- -> 1038 normalize=normalize, bins=bins, dropna=dropna)
- 1039 return result
- 1040
- /usr/lib/python3.6/site-packages/pandas/core/algorithms.py in value_counts(values, sort, ascending, normalize, bins, dropna)
- 714
- 715 else:
- --> 716 keys, counts = _value_counts_arraylike(values, dropna)
- 717
- 718 if not isinstance(keys, Index):
- /usr/lib/python3.6/site-packages/pandas/core/algorithms.py in _value_counts_arraylike(values, dropna)
- 759 # TODO: handle uint8
- 760 f = getattr(htable, "value_count_{dtype}".format(dtype=ndtype))
- --> 761 keys, counts = f(values, dropna)
- 762
- 763 mask = isna(values)
- pandas/_libs/hashtable_func_helper.pxi in pandas._libs.hashtable.value_count_object()
- pandas/_libs/hashtable_func_helper.pxi in pandas._libs.hashtable.value_count_object()
- TypeError: unhashable type: 'list'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement