To learn machine learning which one is good?
I can think of the following pros and cons for each. As for learning to code your own machine learning algorithms such as logistic regression:


You will definitely learn more about specific algorithms, their details, role of different parameters and etc. That is also a good practice of coding itself. Then you can validate your implementation by benchmarking it against other packages and implementations.
You will have more freedom in controlling different aspects of your method. You can add functions and modules as you wish and do not necessary have to deal with predefined variables, methods and etc.


On the other hand, implementing algorithms when it is not necessary and you can just use existing packages is like reinventing the wheel. It normally takes a lot of time and you have to verify your results for each one of them. Packages like sklearn are popular because of the following:


A group of people are working on those, constantly making them up to date, testing the  methods in different situations for different needs. That makes packages like sklearn very dependable and usually scalable.
If you have a question about them, there are tons of resources out there; documentation, forums, source code, communities like StackOverflow where thousands of people are eager to help you literally for any error you face while running your code. 
Another important feature is automated hyperparameters tuning. Most of machine learning algorithms have a series of hyperparameters that need to be optimized in order to achieve the best performance. Packages like sklearn efficiently search for the optimal tuning parameters (or "hyperparameters") for your machine learning model in order to maximize its performance.
Still if you are interested in implementing machine learning algorithms and like the coding, you can always contribute to the existing packages. They usually have Github repositories where you can raise an issue, ask for a new feature or provide help improving them.


All in all, if you have enough time and you are keen to learn low level details about those models, go ahead and give implementation them a shot. That is certainly fun. However, if you need to get to the results as soon as possible and looking for a reliable package where a huge group of people both in industry and academia are already using, sklearn, pandas and others are you options.

Hope this is helpful and good luck.