On 20/02/24 01:04, Chris Green via Python-list wrote:
dn wrote:
On 18/02/24 09:53, Grant Edwards via Python-list wrote:
On 2024-02-17, Cameron Simpson via Python-list wrote:
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-'
On 20/02/24 05:58, Grant Edwards via Python-list wrote:
Here's a demonstration of how to hook custom code into the f-string
formatting engine. It's brilliantly depraved.
https://stackoverflow.com/questions/55876683/hook-into-the-builtin-python-f-string-format-machinery
From the above:
On 2024-02-19, Chris Green via Python-list wrote:
> It's using f'{...}' at the moment.
Here's a demonstration of how to hook custom code into the f-string
formatting engine. It's brilliantly depraved.
Grant Edwards wrote:
> On 2024-02-16, Chris Green via Python-list wrote:
>
> > I'm looking for a simple way to make NaN values output as something
> > like '-' or even just a space instead of the string 'nan'.
>
> It would probably help if you told us how you're "outputting" them now
> (the
dn wrote:
> On 18/02/24 09:53, Grant Edwards via Python-list wrote:
> > On 2024-02-17, Cameron Simpson via Python-list
> > wrote:
> >> On 16Feb2024 22:12, Chris Green wrote:
> >>> I'm looking for a simple way to make NaN values output as something
> >>> like '-' or even just a space instead of
On 18/02/24 09:53, Grant Edwards via Python-list wrote:
On 2024-02-17, Cameron Simpson via Python-list wrote:
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'.
[...]
On Mon, 19 Feb 2024 at 06:47, Grant Edwards via Python-list
wrote:
> I would be tempted to try monkey-patching the float class to override
> the __format__ method. I have no idea what side effects that might
> have, or if it's even used by the various formatting mechanisms, so
> you might end up
On 16/02/2024 23.12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'. This would
then make it much easier to handle outputting values from sensors when
not all sensors are present.
So, for example,
On 2024-02-16, Chris Green wrote:
> I'm looking for a simple way to make NaN values output as something
> like '-' or even just a space instead of the string 'nan'.
I tried monkey-patching the __format__ method of float, but it's
immutable, so that didnt' work. Is float.__format__ what's used
[I've been trying all afternoon to post via slrn, but nothing is
showing up on the list. Forgive me if multiple posts eventually show
up.]
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as
[Posts via slrn and my GMail account aren't showing up, so I guess I'll
try
subscribing from a different e-mail address.]
On 2024-02-17, Cameron Simpson via Python-list
wrote:
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'. [...]
>>
>>Battery Voltages and Currents
>>Leisure Battery -
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'. [...]
>>
>>Battery Voltages and Currents
>>Leisure Battery -
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'. [...]
>>
>>Battery Voltages and Currents
>>Leisure Battery -
On 2024-02-17, Cameron Simpson via Python-list wrote:
> On 16Feb2024 22:12, Chris Green wrote:
>>I'm looking for a simple way to make NaN values output as something
>>like '-' or even just a space instead of the string 'nan'.
>>[...]
>>
>>Battery Voltages and Currents
>>Leisure Battery -
On 2024-02-16, Chris Green via Python-list wrote:
> I'm looking for a simple way to make NaN values output as something
> like '-' or even just a space instead of the string 'nan'.
It would probably help if you told us how you're "outputting" them now
(the Python feaatures/functions used, not
On 16Feb2024 22:12, Chris Green wrote:
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'. This would
then make it much easier to handle outputting values from sensors when
not all sensors are present.
So, for example,
I'm looking for a simple way to make NaN values output as something
like '-' or even just a space instead of the string 'nan'. This would
then make it much easier to handle outputting values from sensors when
not all sensors are present.
So, for example, my battery monitoring program outputs:-
18 matches
Mail list logo