Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Recommendation Systems with Python

You're reading from  Hands-On Recommendation Systems with Python

Product type Book
Published in Jul 2018
Publisher Packt
ISBN-13 9781788993753
Pages 146 pages
Edition 1st Edition
Languages
Author (1):
Rounak Banik Rounak Banik
Profile icon Rounak Banik

Exporting the clean DataFrame

In the previous chapter, we performed a series of data wrangling and cleaning processes on our metadata in order to convert it into a form that was more usable. To avoid having to perform these steps again, let's save this cleaned DataFrame into a CSV file. As always, doing this with pandas happens to be extremely easy.

In the knowledge recommender notebook from Chapter 4, enter the following code in the last cell:

#Convert the cleaned (non-exploded) dataframe df into a CSV file and save it in the data folder
#Set parameter index to False as the index of the DataFrame has no inherent meaning.
df.to_csv('../data/metadata_clean.csv', index=False)

Your data folder should now contain a new file, metadata_clean.csv.

Let's create a new folder, Chapter 4, and open a new Jupyter Notebook within this folder. Let's now import our new...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}