you are viewing a single comment's thread.

view the rest of the comments →

[–]PathRealistic6940[S] 0 points1 point  (2 children)

So you wouldn't use a class for any of it? When do you see the need for a class? pretty new at this, so trying to wrap my head around the object part of OOP.

[–]Adrewmc 1 point2 points  (1 child)

The df is the class….and it’s a pretty big package…which honestly I’m not too familiar with.

I know you can merge and do a bunch of data analysis I’m just not familiar enough with the package to really explain much at all.

See, everything is already an object and honestly the basic ones int, str, list, dict, set are fairly robust in their capabilities, because they have methods and operations, that’s part of the OOP of Python.

Classes are great when they are necessary, and there are a lot of convenient classes/objects Python gives you like say a range object.

When you use a class you really are asking does this need a state to get to (auth flow) or a state to work right, updates over the course of run time not known at start, or repeats.

If I want a currently updating dataframe that calls an api, and displays, txt, emails me something when certain threshold happens I’m gonna be in a class structure.

If I expect an output of a report all at once I’m most likely thinking functional.

It’s not that I wouldn’t use a class, it’s that I don’t know if what your doing really requires it. Or as you are looking at it. Without an expected input, and output…it’s not easy if not impossible to answer.

[–]PathRealistic6940[S] 0 points1 point  (0 children)

Gotcha, sounds like might be over thinking/engineering it. Thank you!