Message Boards Message Boards

0
|
1667 Views
|
5 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Merging two equally long sets of data

Posted 2 years ago

Currently, I have two sets of data present within my notebook, each one column wide and containing the same number of rows (which I generated from two different imported csv files). I wish to merge these two under a new dataset such that I can use ListLinePlot to graph the combined set of data. I have tried a number of functions such as merge or join, but either they don't work the way that I want them to or I am using them incorrectly. What command should I use here to sort this out. I am using version 13.0 of the software.

POSTED BY: Oscar Clement
5 Replies
Posted 2 years ago

It would be easier if you posted a sample of your data. A single column with many rows would usually be interpreted as {{.},...,{.}}, but sometimes people say that when they have {{...}}. A Dataset is yet another construction with many possible configurations. So, while this is a pretty easy question to answer, the specifics will depend on the specific structure of your data. Without sample data, I'm afraid this will turn into a sort of blind trial and error exercise.

POSTED BY: Eric Rimbey
Posted 2 years ago

Hi Oscar,

I think what you need is Transpose

xValues = Range[10];
yValues = xValues^2;

points = Transpose[{xValues, yValues}]
ListLinePlot[points]
POSTED BY: Rohit Namjoshi
Posted 2 years ago

Unfortunately that does not work as the data that I have stored is in the form of datasets. When I try that option, I get the following

a=fktkmv[All,-1];
b=fktkmW[All,1];
c=Tranpose[a,b]

this results in a error which states "Dataset objects do not support arbitrary transpose operations". What can I do to fix this?

POSTED BY: Oscar Clement
Posted 2 years ago

You did not follow the example I gave, you missed { }

c = Tranpose[{a, b}]

For Dataset you need to use the Normal form

c = Tranpose[{Normal@a, Normal@b}]
POSTED BY: Rohit Namjoshi

Welcome to Wolfram Community!
Please provide your trials in terms of Wolfram Language code. This will make it easier for other members to help you.

Check several methods available to include your code in the rules http://wolfr.am/READ-1ST

POSTED BY: Moderation Team
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