clips / pattern

Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
https://github.com/clips/pattern/wiki
BSD 3-Clause "New" or "Revised" License
8.74k stars 1.58k forks source link

Vectorize inefficient python for loops with numpy #331

Open maldil opened 2 years ago

maldil commented 2 years ago

Hi Maintainers of this repo,

Thank you very much for your excellent work, I am new to this repository. I am a researcher studying the best practices of evolving data science codes. According to our findings after examining 1000 data science repositories, migration of loop-based calculations is a widespread evolution practice among developers since it improves performance and code quality. I created this PR to make better use of NumPy functions and avoid unnecessary loops.

This PR is a minor contribution compared to all the hard work that you have done in this repo. However, I am hoping that it will enhance code quality and, hopefully, performance.

maldil commented 2 years ago

@stephantul could you please help to merge this PR

Thynix commented 1 year ago

@maldil You say hopefully it'll improve performance - it sounds like you didn't test it?