This is because os.listdir(path)
returns a list of all files in your data folder, even if there is only one file. As such, you need to get the filename you want in this list before parsing it.
More Related Contents:
- how to check if the number is in the list [duplicate]
- Count consecutive spaces( ) at the start of the string in Python [closed]
- How do I sort this list in Python 3? [duplicate]
- How does exec work with locals?
- What is the ‘@=’ symbol for in Python?
- Deep copy of a dict in python
- Decode Hex String in Python 3
- How to configure Atom to run Python3 scripts?
- Is generator.next() visible in Python 3?
- Improve current implementation of a setInterval
- Argparse with required subparser
- portable way to write csv file in python 2 or python 3
- Sphinx cannot find my python files. Says ‘no module named …’
- I have a high-performant function written in Julia, how can I use it from Python?
- Multiple inheritance metaclass conflict
- Call a function defined in another function
- Equivalent for `–find-links` in `setup.py`
- How to check if an object has an attribute?
- How to fix “ImportError: DLL load failed” while importing win32api
- Name not defined in type annotation [duplicate]
- Hex string to signed int in Python
- Converting Roman Numerals to integers in python
- Confused about Python’s id() [duplicate]
- Deleting consonants from a string in Python
- Updating Python on Mac
- Is there any working memory profiler for Python3 [closed]
- reading multiple files contained in a zip file with pandas
- Python3 project remove __pycache__ folders and .pyc files
- How to properly use the “choices” field option in Django
- pandas scatter plotting datetime