Appearance
Python
Snippets in this category (441–480 of 539).
- String formatting: % vs. .format vs. f-string literal
- Styling multi-line conditions in 'if' statements?
- Sum a list of numbers in Python
- SyntaxError: unexpected EOF while parsing
- Traverse a list in reverse order in Python
- Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
- TypeError: 'module' object is not callable
- TypeError: 'NoneType' object is not iterable in Python
- TypeError: a bytes-like object is required, not 'str' when writing to a file in Python 3
- TypeError: list indices must be integers or slices, not str
- TypeError: method() takes 1 positional argument but 2 were given
- TypeError: Missing 1 required positional argument: 'self'
- Understanding Python super() with init() methods
- Understanding slicing
- Unicode (UTF-8) reading and writing to files in Python
- UnicodeDecodeError, invalid continuation byte
- UnicodeDecodeError: 'charmap' codec can't decode byte X in position Y: character maps to
<undefined> - UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c
- UnicodeDecodeError: 'utf8' codec can't decode byte 0xa5 in position 0: invalid start byte
- UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 20: ordinal not in range(128)
- Unzipping files in Python
- Usage of slots?
- Use a list of values to select rows from a Pandas dataframe
- Use different Python version with virtualenv
- Use of *args and **kwargs
- Using global variables in a function
- Using Python 3 in virtualenv
- ValueError: could not convert string to float: id
- ValueError: invalid literal for int() with base 10:
- ValueError: setting an array element with a sequence
- ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
- What are "named tuples" in Python?
- What are metaclasses in Python?
- What are the differences between the urllib, urllib2, urllib3 and requests module?
- What are the differences between type() and isinstance()?
- What are the most common Python docstring formats?
- What can I do about "ImportError: Cannot import name X" or "AttributeError: ... (most likely due to a circular import)"?
- What do init and self do in Python?
- What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?
- What does %s mean in a Python format string?