Advertisement
Dodma

Untitled

Apr 29th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. games['total_sum'] = games['na_sales'] + games['eu_sales'] + games['jp_sales'] + games['other_sales']
  2. games.head(20)
  3.  
  4. IndexError Traceback (most recent call last)
  5. <ipython-input-42-b15a742c3fc0> in <module>
  6. ----> 1 games['total_sum'] = games['na_sales'] + games['eu_sales'] + games['jp_sales'] + games['other_sales']
  7. 2 games.head(20)
  8.  
  9. /opt/conda/lib/python3.7/site-packages/pandas/core/indexes/base.py in __getitem__(self, key)
  10. 4278 if is_scalar(key):
  11. 4279 key = com.cast_scalar_indexer(key)
  12. -> 4280 return getitem(key)
  13. 4281
  14. 4282 if isinstance(key, slice):
  15.  
  16. IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement