[Tutor] Extract element of dtype object

Mark Lawrence breamoreboy at gmail.com
Sun Dec 6 09:23:13 EST 2020


On 06/12/2020 13:37, Stephen P. Molnar wrote:
> I have a large number of files from which I wish to extract a number.
> 
  [big snip]

> 3     1           0.000      0.000
> 4     2    -8.487003690      3.712      7.079
> Refining results ... done.       1    -8.538750714      0.000 0.000
> Name: 3, dtype: object
> 
> The number that I want to extract is -8.538750714.
> 
> To this point, google has not been a friend. I'm reasonably sure that I 
> am not asking google the correct question. My question to the list is 
> 'What is the question?' that will solve my problem??

Something like 'python read data from file' for starters.  Having done 
that you'll probably need something like this 
https://docs.python.org/3/library/stdtypes.html#str.split

> 
> Thanks in advance.
> 

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Tutor mailing list