I'm getting an error when I'm running the 6th block at CoLab. The code however is running fine on my local computer. Please advise. Thank you.
Pasting the error.
TypeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_value(self, series, key)
2565 try:
-> 2566 return libts.get_value_box(s, key)
2567 except IndexError:
pandas/_libs/tslib.pyx in pandas._libs.tslib.get_value_box()
pandas/_libs/tslib.pyx in pandas._libs.tslib.get_value_box()
TypeError: 'str' object cannot be interpreted as an integer
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
in ()
5
6 for index, row in data.iterrows():
----> 7 ss = sid.polarity_scores(row["Tweets"])
8 listy.append(ss)
9
/usr/local/lib/python3.6/dist-packages/pandas/core/series.py in getitem(self, key)
621 key = com._apply_if_callable(key, self)
622 try:
--> 623 result = self.index.get_value(self, key)
624
625 if not is_scalar(result):
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_value(self, series, key)
2572 raise InvalidIndexError(key)
2573 else:
-> 2574 raise e1
2575 except Exception: # pragma: no cover
2576 raise e1
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_value(self, series, key)
2558 try:
2559 return self._engine.get_value(s, k,
-> 2560 tz=getattr(series.dtype, 'tz', None))
2561 except KeyError as e1:
2562 if len(self) > 0 and self.inferred_type in ['integer', 'boolean']:
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_value()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_value()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'Tweets'