Message Boards Message Boards

0
|
389 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Choosing columns from a Tabular

Posted 1 month ago

I've been going the new dataset type Tabular, but I'm having a hard time to find how to choose a column from a Tabular dataset
For instance, let's assume you have the following tabular dataset

test = Tabular[{<|"location" -> "study", 
      "temperaturesensor" -> "SHTC3"|>, <|"location" -> "basement", 
      "temperaturesensor" -> "BME280"|>, <|"location" -> "familyroom", 
      "temperaturesensor" -> "BME280"|>, <|"location" -> "Study", 
      "temperaturesensor" -> Missing["NotAvailable"]|>, <|
      "location" -> "DiningRoom", "temperaturesensor" -> "MCP9808"|>, <|
      "location" -> "upstairs", "temperaturesensor" -> "MCP9808"|>, <|
      "location" -> "Thermostat", "temperaturesensor" -> "DPS310"|>, <|
      "location" -> "FamilyTV", "temperaturesensor" -> "TMP117"|>, <|
      "location" -> "Indeterminate", 
      "temperaturesensor" -> "BME680"|>, <|"location" -> "LaniStudy", 
      "temperaturesensor" -> "BME680"|>, <|"location" -> "Basement", 
      "temperaturesensor" -> "BME680"|>}];

Let's assume you would like to assign or select only column location, how do you this?
I tried test["location"] like one does in Dataset, but it didn't work.
I tried test[["location"]] still did not work
and other approaches with no success.
Any help will be appreciated

I found out how to do this

test[[All,"location"]]

Then using the following

Normal[test[[All, "location"]]]

will return the values of the chosen column

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

Group Abstract Group Abstract