Why can I not reproduce a nd array manually?

后端 未结 1 336
挽巷
挽巷 2021-01-26 06:20

I\'m confused about these data structures.

From a GIS system, I use a function to extract the meta data (8 different fields)

myList = FeatureClassToNumP         


        
相关标签:
1条回答
  • 2021-01-26 06:58

    Not sure how to do this, but the comment by juanpa.arrivillaga should be marked as the answer.

    Again, why do you expect print(something) to produce a string that is valid python source code to produce that object? That is your fundamental assumption that is wrong. That is what you are missing. print(repr(something)) will often get you something much closer, but it is never guaranteed to be valid source code. Again, likely it returns a numpy.ndarray with some structured dtype. What is myList.dtype? EDIT: so a very basic example, something = object(); print(something) now try to reproduce that from the string representation... there's no reason to expect to be able to. – juanpa.arrivillaga May 13 at 21:18

    My question originates from a fundamental misunderstanding of what a dataframe is and how it works. Took me while to work it out.

    In my words, it's an object that needs to be manipulated through various tools/functions... it's not just a matrix of "strings".

    0 讨论(0)
提交回复
热议问题