Questions tagged [multiple-columns]

Multiple-columns are when text is split into a number of parallel text columns, rather than one column of text. For CSS Multicolumn layout, use the [css-multicolumn-layout] tag.

Multiple-columns are often found in newspapers and magazines, where a single column of text would create a line length longer than the ideal width of optimal readability.

Text can be set to use multiple-columns in CSS by using the CSS Multiple-column layout module.

5872 questions
1
vote
4 answers

How to split 1 column in excel into 2 separate columns

Question Given a single column of weight_and_units which looks something…
Curious
  • 325
  • 1
  • 10
1
vote
1 answer

How to treat as a single column whatever comes in parentheses in python

I have a CSV file, which I am reading it with Pandas. There is a situation where I am splitting a single column into multiple column by space. Example: CSV: ID , Reference 101 , WHERE ID = 'TEST' 102 , WHERE ID IN (A,B,C) 103 , WHERE ID IN ("Hello…
Kapil Sharma
  • 41
  • 1
  • 5
1
vote
2 answers

Stack multiple columns in a text file

I'm trying to save a txt file in Python through numpy.savetxt. The data should be organized in columns that I read from a 2 dimensional list: basically I need to write np.column_stack((noise[:,0], noise[:,1], ..., noise[49])) In the end 50 columns…
1
vote
3 answers

Make a column based on specific values from other column pandas python

I got this dataframe Contact Title 1 Dear Sir White, 2 Dear Madam Ford, 3 Dear Sir / Madam Hendricx, I want to make another column called 'Gender' based on the column 'Title' Contact Title Gender 1 Dear Sir White, M 2 Dear…
Monkey D
  • 69
  • 4
1
vote
4 answers

Split a column value into Multiple columns based on an ID in R

I have a dataset that has different timepoints for each ID. I want one record per ID where I want the timepoints to be split in different columns . I dont want to use spread as I want the actual value of the column. Some of the IDs have 14 records…
Datamaniac
  • 171
  • 2
  • 9
1
vote
2 answers

Creating multiple new columns based on existing columns (dplyr)

I'm trying to automate creating variables indicating whether students' answer (variables beginning with l,m, f or g) to the questions (eg. variables starting in "test_") are correct or not. ie. This done by checking whether, for example, test_l1 ==…
ravman
  • 25
  • 4
1
vote
1 answer

How to map 2 columns by using 2 dataframe in pandas?

df_map Camp_old Camp_New Plat A_B C_D Car E_F G_H Auto W_X Y_Z Star df_main Camp Num W_X 5 E_F NaN A_C_R 3 A_B 6 I want to…
s_khan92
  • 969
  • 8
  • 21
1
vote
1 answer

Collapsing a column value into lines, copying values of a second column

I have a file with two columns (tab-separated): In the first column I have the number of lines that I want to collapse, and in the second column is the number that I want to be pasted in each row (in a new file), based on the first column…
guidebortoli
  • 659
  • 3
  • 8
  • 16
1
vote
1 answer

Python - How can I combine two data frames on 3 columns and keep columns from both dataframes?

I have two data frames and I want to add them one on top of another, joined by 3 columns, but also keep columns from both data frames. The two data frames are: data_top = [{'Date': '15/06/2021', 'Code_top': 'a', 'ID_top': 1, 'Portfolio_top':100,…
StefaaanP
  • 47
  • 1
  • 4
1
vote
1 answer

subtract multiple columns at once

I have two dataframes: df_1 = pd.DataFrame({'a' : [7,8, 2], 'b': [6, 6, 11], 'c': [4, 8, 6]}) df_1 and df_2 = pd.DataFrame({'d' : [8, 4, 12], 'e': [16, 2, 1], 'f': [9, 3, 4]}) df_2 My goal is something like: In a way that 'in one shot' I can…
Victor Castro
  • 105
  • 1
  • 6
1
vote
2 answers

How to read first four columns from a file with different number of columns on each row into a data frame

I have a text file whose first 10 rows look like these: 3 a 1 4 6 2 3 a 1 4 6 2 4 a 1 4 6 8 2 4 a 1 4 6 8 2 3 a 1 4 6 2 3 a 1 4 …
1
vote
2 answers

SQL / Postgresql count multiple columns with conditions

I have a simple table of the form: id gender a_feature (bool) b_feature (bool) ... xyz_feature (bool) and I want to sum over all feature columns dependent on…
1
vote
3 answers

Vector to a matrix where the next row starts 1 observation

Suppose I have a data set with 40 observations y <- rnorm(40,10,10) Now I would like to transform this vector into a matrix with 4 observations in each row. On top of that, I would like the row to start with value y[i] and add one each iteration…
Wietze
  • 109
  • 7
1
vote
1 answer

Rolling computation to identify mismatch between two columns

I have data that includes student scores in their mid-terms and their final exams. This data is arranged in a wide format, where each row corresponds to a unique student ID shown as SUID. My data also includes information about teachers, which…
Sandy
  • 1,100
  • 10
  • 18
1
vote
2 answers

how to drop a pandas multi level dataframe column when all sub columns are completely blank

dataframe: |--------------------------------------------------------------------| | Name | email | Phone no | Gender | |----------------|-------------------|--------------|----------------| |legacy | target |legacy …
Sri
  • 85
  • 4