Resolved: .values attribute of panda data frames return numpy array containing different types
Why does the .values attribute of panda data frames return numpy array containing different types (int, str)? see lending_co_data.values line. Thank you!
Thanks for reaching out.
This is by construction, i.e. - how the creators of the .values attribute want this attribute to be appleid.
.values is an attribute that indeed returns a NumPy array.
Although you can still encounter
.values largely used in the pandas code worlwide, in today's version of pandas, its creators suggest that we use
.to_numpy(). In any case, using
.values isn't necessarily going to be erroneous in the code you will be writing.
Please visit the following links from the documentation for more information. Thank you.
Hope this helps.