YufenginTowards Data ScienceHow to Merge Data Frames by The Nearest Match in Pandas? Use merge_asof.A short post about a useful function in Pandas, merge_asof. It’s one of the most used tools in Pandas when dealing with time series data.·5 min read·Feb 18, 2024--1--1
YufengUse Set Instead of List in Membership Test, Especially for Large DatasetsPrioritize the O(1) operation instead of one-liners in your Python code·3 min read·Feb 16, 2024----
YufenginTowards Data ScienceImplement Agglomerative Hierarchical Clustering with PythonIn this post, I briefly go over the concepts of an unsupervised learning method, hierarchical clustering, and its implementation in Python·9 min read·Jan 18, 2024--1--1
YufengEfficient Data Loading with PandasMastering Efficient Data Loading: Practical Techniques and Code Examples in Pandas·6 min read·Dec 22, 2023----
YufengUnlocking the Power of assign() in PandasCreating new columns efficiently using Pandas' assign() method·4 min read·Jul 20, 2023--2--2
YufenginTowards Data ScienceSlicing A Pandas Dataframe Using “&” and “|” Instead of “and” and “or”when you see ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()·6 min read·Apr 14, 2023--1--1
YufenginTowards Data ScienceUse to_string() to Stop Python from Hiding the Body of the Printed DataFramesWhat should we do to see the entire printed dataframe after the execution of a Python script?·4 min read·Apr 10, 2023--1--1
YufenginTowards Data ScienceWhat If .apply() Is Too Slow?Sometimes we need to apply some function to the Pandas Dataframe in Python by using its column(s) as the function's input. However, one of…·6 min read·Dec 8, 2022--1--1
YufenginTowards Data ScienceUnderstanding Affinity Propagation Clustering And Implementation with PythonOne of the most used clustering methods, affinity propagation, is clearly explained together with the implementation with Python·7 min read·Sep 2, 2022----
YufengTypeError: unhashable type: ‘list’! How to Drop Duplicates with Lists in PandasIn this short post, I’m writing about several tricks about dealing with list values in the data frame in Pandas. You may find them useful…·5 min read·Jul 22, 2022----