0

I am currently trying to improve the speed of my python 3 code is and I ran a cProfile on my code to see what takes up the most time. The problem is that I don't understand what those methods represent from the output.

I attached below the output from the console ordered by the most time that it took. I tried googling the said methods but did not find anything useful. If someone knows what they mean or if there is a specific website that has a dictionary of what those are it would be perfect. Thank you!

enter image description here

Adrian
  • 774
  • 7
  • 26
  • 1
    `__init__`, `__enter__`, `__exit__` are about initialising classes and contexts. The crucial information is in the `filename` column. If you're using pandas you're probably using some sort of machine learning thing. In which case, 10 minutes might not be so bad. I would focus on improving obvious things in the code you've written, rather than cProfile. – blueteeth Jan 24 '19 at 19:21
  • @blueteeth Thank you for explaining that! I am indeed using pandas to calculate some metrics. If I were to understand it correctly, the `__init__`, `__enter__`, `__exit__` are used when specific methods from a class inside a library are called? – Adrian Jan 25 '19 at 15:10
  • 1
    Yes, I would guess so. – blueteeth Jan 25 '19 at 18:08

0 Answers0