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.Feb 181Feb 181
YufengUse Set Instead of List in Membership Test, Especially for Large DatasetsPrioritize the O(1) operation instead of one-liners in your Python codeFeb 16Feb 16
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 PythonJan 181Jan 181
YufengEfficient Data Loading with PandasMastering Efficient Data Loading: Practical Techniques and Code Examples in PandasDec 22, 20231Dec 22, 20231
YufengUnlocking the Power of assign() in PandasCreating new columns efficiently using Pandas' assign() methodJul 20, 20232Jul 20, 20232
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()Apr 14, 20231Apr 14, 20231
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?Apr 10, 20231Apr 10, 20231
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…Dec 8, 20221Dec 8, 20221
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 PythonSep 2, 2022Sep 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…Jul 22, 2022Jul 22, 2022