From the course: Exploring Data Science with .NET using Polyglot Notebooks & ML.NET

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Merging DataFrames

Merging DataFrames

- [Instructor] Sometimes your data will be split across multiple data files, and you'll want to be able to merge these data files together into a larger data source. It's very similar to a SQL join kind of operation. Here we have the DataFrame we've been working with thus far, dealing with customer data, but this time it's named dfCust instead of df. We also are loading the data from the products.csv file and storing it in a dfProducts variable. We can see these two DataFrames here. Notice how the DataFrame Customers has a product ID or prodID. We can see here the first row is FT139. Similarly, the df.Products DataFrame has an ID column that contains the same key. Now, here I am ordering both of these DataFrames by the appropriate column and then getting the first row. But trust me that all these values are present in our DataFrame. The next thing I want to do is I want to call the merge operation on one of my DataFrames and provide it the other DataFrame as well as the information on…

Contents