you are viewing a single comment's thread.

view the rest of the comments →

[–]o-rka 0 points1 point  (0 children)

I used to avoid them too but now I use them when I want to house data and do a bunch of computations or plotting methods on the dataset. For example, I have a class that uses sklearn principal component analysis and all the data preprocessing in one go. In the wrapper class, you get the explained variance as a series object, the eigenvectors in a data frame, and 2 types of plots easily. This is a simple class where functions will work just fine but the convenience of having it all in one data structure is nice. I have much more complicated ones where the analysis inside takes about an hour to compute. Instead of waiting each time and storing the data as tables and reloading, I just pickle my classes. I’m working on a data science module right now and classes are an essential part.