Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 2
    The hash will be different for different object. Both dataframe are not the same. Try df1.values.tostring() == df2.values.tostring(), it should be false. If you want to have the same hash, you need to remove the data in the values before taking the hash. Commented Apr 17, 2018 at 16:37
  • 1
    yes it is False. Is there any other way i can geneate a unique code based on the data in the file? (excluding some part of the data) Commented Apr 17, 2018 at 16:41
  • 1
    you can try: hash(df1[:-1].values.tostring()) to remove the last column. Commented Apr 17, 2018 at 16:54
  • 2
    Possible duplicate of Most efficient property to hash for numpy array Commented Apr 17, 2018 at 17:08
  • 1
    @TwistedSim last column is not in the dataframe anyway. i am loading first 13 characters only Commented Apr 17, 2018 at 17:14