Data transformation is the process of converting data from one format or structure into another format or structure. This can range from a simple transformation like transforming a comma-separated list to a line-break-separated list to complex transformations like speech-to-text. Strategies and technologies used can vary widely based on the complexity, volume, format and structure of the data being transformed.
Questions tagged [data-transform]
152 questions
1
vote
4 answers
Transforming Matrix in R
I currently face issues transforming the matrix to the format below. How do I achieve this in R in the easiest way? Ideally, I would like to use the second matrix as a data frame. Many thanks in advance!
Estonia Germany Poland
Estonia 0 …
MixedModeler
- 15
- 5
1
vote
1 answer
Generate periodic time series of active ID based on the open ID time and close ID time
I have a tibble such that for each row contains the open date and close date for an ID.
Given these 2 information, I should be able to extract how many IDs were active on each week, how many were closed on each week, and the rate of growth of active…
Afiq Johari
- 926
- 1
- 8
- 18
1
vote
1 answer
Why the error "factor level [2] is duplicated" will occur?
I tried to convert the month variable (which is an integer) into a categorical variable using factor(month), but I failed because of the error. How could I solve it?
This is my…
Jing Xu
- 15
- 2
1
vote
0 answers
Data transformation with and without Min-max scaling
I am trying to test Tukey's Bulging Rule or Ladder of Powers (Ref Image). I discovered that I am able to reproduce the transformation (from right skewed to less right-skewed OR left skewed to less left-skewed) only if I scale my data.
I chose…
watchtower
- 3,510
- 9
- 35
- 72
1
vote
3 answers
Convert list into dataframe using tags as the values of a new column (with R)
I have a list like this:
require(tidyverse)
months <- c("january", "february", "march", "october", "december")
weekdays <- c("Sunday", "Monday", "Tuesday")
seasons <- c("Summer", "Winter", "Fall", "autumn")
timeWords_list <- tibble::lst(months, …
Fidel Alencar
- 35
- 3
1
vote
2 answers
Pandas: from adjacency matrix to series of node lists
I have which I think is a pretty general problem. Namely, to recast a bipartite adjacency matrix in a list of a list of nodes. In Pandas, that would mean transform from a specific pd.DataFrame format to a specific pd.Series format.
For non…
HerrIvan
- 511
- 3
- 14
1
vote
1 answer
How to transpose a table in Power BI from Row to Column
I am having trouble structuring my PowerBI data in the required format. I am attaching the data structure below.
My Data Structure:
Required Output Structure:
Jithu K
- 11
- 1
1
vote
1 answer
Transform dataframe data in R
I have a dataframe in R of data look likes this:
and I want to transform the table to this
What is the fastest way to do it in R?
Here is how I did it, but I admit that it's very long
method_vec <- c(rep("PCA", 6), rep("Specter", 6),rep("Seurat",…
Thomas Edison
- 167
- 7
1
vote
2 answers
Read content of a text file as SELECT result (SQL Server)
I need a way to read the contents of a HTML file and return it as a column within a SQL server query.
To set the scene I'm working on a query that gathers all the data needed to export products from an ERP system and import it into eBay, but I need…
Josh
- 105
- 8
1
vote
1 answer
How to plot a horizontal stacked bar with annotations
I used the example for Discrete distribution as horizontal bar chart example on matplotlib Discrete distribution as horizontal bar chart to create a chart showing share of the vote in Shropshire elections 2017.
However, because I did not know how…
Mark Kirby
- 13
- 2
1
vote
2 answers
How to use JavaScript to turn csv file with hierarchy relationships to an object?
I have an csv file that contains an organization hierarchy data, one of the fields is the id of that employee's subordinates' ids.
The csv file is something looking like this:
id,name,title,children
n1,Lao Lao,general manager,"n2,n3,n9,n10"
n2,Bo…
user13980714
- 13
- 1
- 3
1
vote
1 answer
Inverse Hyperbolic Sine Transformation in R for data with many 0's
I am trying to use the inverse hyperbolic since (IHS) transformation on a non-normal variable in my dataset. The code that I found on the internet is not working for me. This is what I tried:
ihs <- function(col) {
transformed <-…
Hannah
- 11
- 2
1
vote
1 answer
How to add a new column to extract a number/character from column 1 when column 2 reaches the max within each group?
I have 3 columns. C1 and C2 are grouped by C0. Now I want to extract the C3 value where it satisfies when C1 is maximum within each C0 group.
df = data.frame(C0 = c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3),
C1 = c(0,2,3,6,2,0,0,4,9,7,1,2,7,4,2),
…
XM_Z
- 39
- 5
1
vote
1 answer
Azure Data Factory / Aggregate as comma separated string
I want to aggregate by data using Aggregate.
Here is the scenario:
I've a table having values as below:
Key | Value
1 | v1
1 | v2
2 | v1
2 | v3
After performing aggregation, I want output as below:
Key | Value
1 | v1, v2
2 | v1, v3
I…
Saadi
- 2,079
- 2
- 16
- 45
1
vote
1 answer
Save time ranges with dates based on data set time blocks in java
I need to convert an ArrayList set of data into another ArrayList set of data. I need to convert "Original data" into "Needed result" below. Basically, I have time blocks of dates and times and need to see which data sets fall within the same time…
rsaaay
- 11
- 2