Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.8K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Assigning keys to columns of Dataset while importing?

Posted 3 years ago
Attachment

Attachments:
POSTED BY: Antonia Duncan
3 Replies
Posted 3 years ago

If the Excel file has column headers use

Import[<file>, {"Dataset", 1}, HeaderLines -> 1]

If it does not then after the import

headers = {"Date", "Cases"};
ds[All, AssociationThread[headers, #] &]

where ds is the imported Dataset.

POSTED BY: Rohit Namjoshi
Posted 3 years ago

It would be easier to help if you provided:

  • The shape of the original data (what does the excel sheet look like? or just paste the heading and a couple of rows for us to look at)
  • The shape of what you want it to look like in Mathematica. Or maybe it makes more sense to tell us what you want to be able to do with this data, and then we can suggest a representation.

The code you posted is too much of a mess to try to untangle, and I suspect that you've modified your actual code to try to simplify your question. So, it'd just be easier if you explain what you have and what your objective is.

POSTED BY: Eric Rimbey

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

The rules explain how to format your code properly. Posting code Images doesn't help other members to copy your code. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

You can also embed notebook or attach notebook.

enter image description here

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