I have a #timeseries of values at low temporal resolution where the values represent an average of the respective surrounding intervals.
I wish to up-sample this sequence to a higher temporal resolution in such a way that the average of the up-sampled values is equal to the corresponding value from the original time series.
Does an #algorithm for the kind of interpolation I am looking for exist? (not Pandas' resample or SciPy's signal.resample.) And is there an implementation of it in #Python?
=> More informations about this toot | View the thread
[#]jerusalemartichoke is a nice winter vegetable. When pretty much everything else in my garden is cold, wet and dead, I can go and dig up these big ol’ root crops and cook a nice warm soup 😋
I think Jerusalem artichoke is a weird term. I have no idea what they have to do with Jerusalem. They seem to have absolutely nothing to do with artichokes. The part of artichokes we eat is a flower, but these are roots, so completely opposite parts of their respective plants 🤷🏻♂️
In Danish: jordskokker.
=> More informations about this toot | View the thread
This answer on SO was helpful: https://stackoverflow.com/a/79383870/865169
Use convert_dtypes
on the output of diff
. This converts the Series to Pandas boolean, which is nullable and can contain the NaNs - problem solved.
It does not tell me how to correctly use infer_objects
, but luckily I will not have to deal with that for now.
=> More informations about this toot | View the thread
How do I correctly apply Pandas' 'infer_objects' function?
I try the following example in Pandas 2.2.3:
outage_mask = pd.Series(([True]*5 + [False]*5)*5, index=pd.date_range("2025-01-01", freq="1h", periods=50)) [ts for ts in outage_mask.loc[outage_mask.diff().fillna(False)].index]
This gives me a warning about downcasting object dtype arrays on 'fillna'. I cannot figure out how to apply the suggested 'infer_objects' correctly 🤔
https://stackoverflow.com/q/79383833/865169
=> More informations about this toot | View the thread
My recent post https://fosstodon.org/@arildsen/113634000119166671 may have given some the impression that I think #LLMs and #AI are quite hopeless. This is not the case.
I do think LLMs can be useful and ChatGPT has saved me hours of work in designing #programming solutions. I pointed out a failure mode of ChatGPT which I find very annoying in my previous post. Here is something I think it can be very good at: saving me the time of trawling through endless SW library documentation.
=> More informations about this toot | View the thread
One problem is that ChatGPT proposed something that sounded compelling enough to make me spend at least an hour testing it and finding out that it does not work.
What's more is that when I point out that it is not working, ChatGPT straightforwardly concludes something like: "You are absolutely right this does not work. Here is why."
This is just so piss-boilingly arrogant to me. This really demonstrates how #AI can be very counter-productive.
=> More informations about this toot | View the thread
I am growing increasingly tired of #chatgpt, which I still use for #programming advice from time to time.
Today I asked it how to implement a particular workflow in Git. It suggested a plausible-sounding and simple solution. I went and tested the solution and it does not work.
On closer inspection, it cannot work. it could be made to work with some complicated and cumbersome work-arounds that defy the whole purpose of my desired workflow.
=> More informations about this toot | View the thread
[#]alttext: I get that it is a great idea for visually impaired persons and I try myself to add useful alternative text to all images I post here on Mastodon.
On the other hand, isn’t it a bit of a double-edged sword? Aren’t we also feeding #AI products lots of annotated training material for free?
=> More informations about this toot | View the thread
Can I define custom insert behaviour in a #SQLAlchemy ORM-mapped class which is used when I call sqlalchemy.orm.Session.add
and perhaps sqlalchemy.orm.Session.bulk_save_objects
?
This is so I would not have to make sure to use a custom MyData.insert method, but could just rely on the usual mechanisms of SQLAlchemy: session.add(my_data)
.
I have looked for, for example an insert method in ORM-mapped classes to override, but I have not found anything like that.
[#]Python
=> More informations about this toot | View the thread
I have a #Python application using lots of different packages and many of them are #logging output.
I would like to clean up my application's logs and perhaps disable some of the other packages' output.
My problem is that I do not know where many of these log messages are coming from.
Can I configure / turn something on in Python's logging at a global level that lets me identify where the messages are coming from?
=> More informations about this toot | View the thread
Wow, stunning #aurora tonight in Aalborg, Denmark 🤩
I have never seen it this clearly here in Denmark before. I feel very lucky to have caught this rare view of it tonight.
=> View attached media | View attached media | View attached media
=> More informations about this toot | View the thread
I went #mushroom hunting today. My sons and I found a decent helping of #chantarelles, but it has been dry lately and it looks like we are nearing the end of the season. I wonder if they might get a comeback if we get some wetter weather.
=> More informations about this toot | View the thread
Why can I unpack a #Python set when sets are unordered?
https://stackoverflow.com/q/78931736/865169
[#]computerscience
=> More informations about this toot | View the thread
=> This profile with reblog | Go to arildsen@fosstodon.org account This content has been proxied by September (3851b).Proxy Information
text/gemini