Group Abstract Group Abstract

Message Boards Message Boards

1
|
3.4K Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

A problem with Dataset

Posted 2 years ago
3 Replies
Posted 2 years ago

Maybe I can reverse-engineer your question. Let's say we have,

TestDataset =
  Dataset[
    {<|"hcont" -> DateObject[{2022, 10, 14}], "hdeb" -> DateObject[{2022, 10, 13}]|>,
     <|"hcont" -> DateObject[{2022, 10, 12}], "hdeb" -> DateObject[{2022, 10, 11}]|>}]

I can apply a function to each of the rows, maybe something like this,

TestDataset[All, <|"hcont2" -> #hcont, "hdeb2" -> #hdeb, "diff" -> (#hcont - #hdeb)|> &]

enter image description here

Is that the kind of thing you're trying to do?

POSTED BY: Eric Rimbey

Thanks, Eric; in fact, it is merely a problem of missing data, not of date! I've been confused by the diagnosis of Mathematica:

Failure[DateObject, 
Association[
 "MessageTemplate" :> MessageName[DateObject, "str"], 
  "MessageParameters" -> {
HoldForm["hcont"], 
HoldForm[{"DateTimeShort"}]}]]
POSTED BY: Claude Mante
Posted 2 years ago

I would you suggest that you pare this down to a minimal example that demonstrates the exact place where you're having struggles. Like, maybe provide a one line expression that doesn't work as you expect along with the "correct" result that you're looking for. As it stands, it looks like I must first figure out all of your variables before I can even parse your question.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard