How do I design a class in Python?

后端 未结 6 1755
终归单人心
终归单人心 2021-01-29 16:59

I\'ve had some really awesome help on my previous questions for detecting paws and toes within a paw, but all these solutions only work for one measurement at a time.

No

6条回答
  •  太阳男子
    2021-01-29 17:25

    After skimming your linked code, it seems to me that you are better off not designing a Dog class at this point. Rather, you should use Pandas and dataframes. A dataframe is a table with columns. You dataframe would have columns such as: dog_id, contact_part, contact_time, contact_location, etc. Pandas uses Numpy arrays behind the scenes, and it has many convenience methods for you:

    • Select a dog by e.g. : my_measurements['dog_id']=='Charly'
    • save the data: my_measurements.save('filename.pickle')
    • Consider using pandas.read_csv() instead of manually reading the text files.

提交回复
热议问题