I had a doubt on how to create an empty csv file where I can open it later to save some data using python. How do I do it? Thanks
标签:
python-2.7
相关问题
- Flush single app django 1.9
- How to stop a dbus gobject loop
- Python's difflib SequenceMatcher speed up
- Getting 'Missing required field: member' w
- What can be the maximum “POST” size I can have?
相关文章
- Is there a size limit for HTTP response headers on
- Does there exist empty class in python?
- ImportError: No module named twisted.persisted.sty
- Get a header with Python and convert in JSON (requ
- python unit testing methods inside of classes
- Requiring tensorflow with Python 2.7.11 occurs Imp
- Generate Fortran subroutine with SymPy codegen for
- Python - What is a lazy property?
An empty csv file can be created like any other file - you just have to perform any operation on it. With bash, you can do
touch /path/to/my/file.csv
.Note that you do not have to create an empty file for python to write in. Python will do so automatically if you write to a non-existing file. In fact, creating an empty file from within python means to open it for writing, but not writing anything to it.
you can also use Pandas to do the same as below:
After creating above file you can Edit exported file as per your requirement.