Dan | Machine Learning Engineer
Dan | Machine Learning Engineer

@DanKornas

7 Tweets Dec 09, 2022
Day 15 of #60daysOfMachineLearning
🔷 Data Prep 2🔷
After collecting all the information that you need (usually as raw data) you need to extract and prepare the information that is most important to train your ML model. This is where you need to know how to parse various files.
💠 Opening a File
To open a file for reading it is enough to specify the name of the file.
Note: Make sure the file exists, or else you will get an error.
💠 Read Files
💠 Read line per line of a file
💠 Write/Create Files
To write to an existing file, you must add a parameter to the open() function:
"w" - Write - will overwrite any existing content
💠 Delete files
To delete a file, you must import the OS module, and run its os.remove() function.
If you missed the previous days, don't worry! You can follow along and go back to day 1 by going to this link 👇

Loading suggestions...