>>> x = ['Jack', 18, 'IM-101', 99.9]
>>> [e for e in x if isinstance(e, int)]
[18]
More Related Contents:
- Pythonic way in loading multiple directories
- How do I read a large csv file with pandas?
- How to write the Fibonacci Sequence?
- Sieve of Eratosthenes – Finding Primes Python
- How to “test” NoneType in python?
- What is the best way to open a file for exclusive access in Python?
- List directory tree structure in python?
- ValueError: could not convert string to float: id
- Is it possible to get color gradients under curve in matplotlib?
- How do I remove duplicates from a list, while preserving order?
- How to flatten a hierarchical index in columns
- Working with TIFFs (import, export) in Python using numpy
- What does [:] mean?
- PYODBC–Data source name not found and no default driver specified
- Trace Python imports
- Python Mysql, “commands out of sync; you can’t run this command now”
- How to modify the navigation toolbar easily in a matplotlib figure window?
- gunicorn command not found, but it’s in my requirements.txt
- Fetching the output of a command executed through os.system() command [duplicate]
- Getting value from select tag using flask
- Error in installing Matplotlib : fatal error C1083
- Is there an analysis speed or memory usage advantage to using HDF5 for large array storage (instead of flat binary files)?
- Cannot open new Jupyter Notebook [Permission Denied]
- Multiple keys per value
- How to install a package using the python-apt API
- Delete every non utf-8 symbols from string
- How to perform bilinear interpolation in Python
- Resample time series in pandas to a weekly interval
- How can I run a Python script in HTML?
- Multiple lookup_fields for django rest framework