Interpolation in Pandas #41 of 53: The Complete Pandas Course

Опубликовано: 20 Июнь 2022
на канале: Selva Prabhakaran (ML+)
1,605
20

Interpolation is also another method, but you should be a little bit careful about when to use interpolation to impute your data.

Interpolation is more relevant when there is some sort of a sequential information or ordered information inside your data. Let's see you it works


Complete PANDAS COURSE for FREE: http://surl.li/cectw

Join ML+ membership for exclusive Data science content

Checkout complete Data Scientist Learning Path here: https://edu.machinelearningplus.com/s...


🔹 Impute Dataframe with INTERPOLATION in Python Pandas with easy Steps.


For example, if you have two data points say this is one data point where the coordinates the values or the coordinates are x naught and y not and this is another data point with x one and y one you have a third data point where only the x this part is not only the X is known, you can find out the value of y using interpolation.

And in most practical cases, interpolation is more suitable when you're dealing with sequential data. When I say sequential the x axis over here usually represents the row index or some sort of a time element or it could be some order details, let's see an example of this.

Here we have a dictionary this dictionary contains what is the fare for the various different classes say first class the pair is 102nd class is not known third class and open classifiers given you make this as a series, this series has an index component and this is the value component. Now in this one, we know the values of the various different classes within it.

Now, here we have the information about the first class third class and open class we want to find out what is the fare for second class you can use interpolation for this because there is an inherent ordering to this and you need to make sure that this is ordered in the right fashion first class comes first second class which is expected to have a slightly higher fare compared to first class.

Let me know in the comments section if you have any questions!


🤝 Like, Share, Subscribe for more!


Follow us on our social media handles for all updates, events and live sessions-

✅ Instagram:   / machinelearningplus  

✅ LinkedIn:   / machine-learning-plus  

✅ YouTube:    / numyard  

✅ Twitter:   / r_programming  

✅ Website: https://www.machinelearningplus.com/


If you enjoyed this video, be sure to throw it a like and make sure to subscribe to not miss any future videos!


Thanks for watching!

#machinelearningplus #python #pandas #datascience