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.
5,911
questions
1512
votes
3
answers
2.2m
views
Using group by on multiple columns
I understand the point of GROUP BY x.
But how does GROUP BY x, y work, and what does it mean?
923
votes
9
answers
1.4m
views
SQL multiple column ordering
How can I sort multiple columns in SQL and in different directions? For instance, 'column1' would be sorted descendingly and 'column2' ascendingly.
660
votes
21
answers
537k
views
Expand a div to fill the remaining width
I want a two-column div layout, where each one can have variable width e.g.
div {
float: left;
}
.second {
background: #ccc;
}
<div>Tree</div>
<div class="second">...
376
votes
17
answers
356k
views
Apply pandas function to column to create multiple new columns?
How to do this in pandas:
I have a function extract_text_features on a single text column, returning multiple output columns. Specifically, the function returns 6 values.
The function works, however ...
351
votes
13
answers
642k
views
Scrolling a flexbox with overflowing content
Here's the code I'm using to achieve the above layout:
.header {
height: 50px;
}
.body {
position: absolute;
top: 50px;
right: 0;
bottom: 0;
left: 0;
display: flex;
}
...
335
votes
8
answers
315k
views
How do I change Bootstrap 3 column order on mobile layout?
I'm making a responsive layout with a top fixed navbar. Underneath I have two columns, one for a sidebar (3), and one for content (9). Which on desktop looks like this
navbar
[3][9]
When I resize ...
326
votes
12
answers
264k
views
Unique Key constraints for multiple columns in Entity Framework
I'm using Entity Framework 5.0 Code First;
public class Entity
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public string EntityId { get; set;}
public int FirstColumn { get;...
156
votes
8
answers
273k
views
LINQ to SQL: Multiple joins ON multiple Columns. Is this possible?
Given:
A table named TABLE_1 with the following columns:
ID
ColumnA
ColumnB
ColumnC
I have SQL query where TABLE_1 joins on itself twice based off of ColumnA, ColumnB, ColumnC. The query might look ...
156
votes
9
answers
665k
views
Combine two or more columns in a dataframe into a new column with a new name
For example if I have this:
n = c(2, 3, 5)
s = c("aa", "bb", "cc")
b = c(TRUE, FALSE, TRUE)
df = data.frame(n, s, b)
n s b
1 2 aa TRUE
2 3 bb FALSE
3 5 cc TRUE
Then how do I combine the ...
154
votes
10
answers
98k
views
IntelliJ Column Selection using Cursor Keys
Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop.
For instance when I'm typing ...
151
votes
19
answers
315k
views
How to print third column to last column?
I'm trying to remove the first two columns (of which I'm not interested in) from a DbgView log file. I can't seem to find an example that prints from column 3 onwards until the end of the line. Note ...
112
votes
4
answers
196k
views
Select NOT IN multiple columns
I need to implement the following query:
SELECT *
FROM friend
WHERE ( friend.id1, friend.id2 )
NOT IN (SELECT id1,
id2
FROM likes)
But ...
105
votes
8
answers
183k
views
Python Pandas - Changing some column types to categories
I have fed the following CSV file into iPython Notebook:
public = pd.read_csv("categories.csv")
public
I've also imported pandas as pd, numpy as np and matplotlib.pyplot as plt. The ...
81
votes
1
answer
61k
views
Half columns in Twitter Bootstrap 3
I couldn't figure out how to make the bootstrap column like this:
col 3 | col 4.5 | col 4.5
77
votes
8
answers
127k
views
flow 2 columns of text automatically with CSS [duplicate]
I have the code similar to the following:
<p>This is paragraph 1. Lorem ipsum ... </p>
<p>This is paragraph 2. Lorem ipsum ... </p>
<p>This is paragraph 3. Lorem ipsum .....
77
votes
8
answers
138k
views
Have two columns in Markdown
I would like to write a coding standard specification document with good and bad coding examples. Each rule should have a number, a description and an example.
For example here is the rule 1:
# ...
57
votes
3
answers
105k
views
How does cellForRowAtIndexPath work?
I HAVE READ apple documentation and it's not understandable for such a beginner in Objective-C as me. I'm trying to implement multicolumn UITableView following this link example and it just doesn't ...
56
votes
2
answers
122k
views
How to access a column in a list of lists in python
I have a 2D array in python modeled by a list of lists and I want to extract the column. I made a quick research and I found a way that uses numpy arrays. The problem is that I do not want to use ...
51
votes
6
answers
149k
views
How to Customize Bootstrap Column Widths?
I have this, but I feel 4 is too big for my sidebar width and 3 is too small (it has to add up to 12).
<div class="col-md-8">
<div class="col-md-4">
I tried this but it doesn't work:
...
50
votes
3
answers
43k
views
Creating UNIQUE constraint on multiple columns in MySQL Workbench EER diagram
In MySQL Workbench's EER diagram, there is a checkbox to make each column in a table unique, not null, primary key etc.
However, I would like to have a UNIQUE constraint on multiple columns. Is it ...
48
votes
4
answers
98k
views
How to paste columns from separate files using bash?
Using the following data:
$cat date1.csv
Bob,2013-06-03T17:18:07
James,2013-06-03T17:18:07
Kevin,2013-06-03T17:18:07
$cat date2.csv
2012-12-02T18:30:31
2012-12-02T18:28:37
2013-06-01T12:16:05
...
47
votes
3
answers
116k
views
Bootstrap 3 Multi-column within a single ul not floating properly
I have been encountering problems like this on the current bootstrap 3 for a while now. I have managed to fix them in the past in one way or another but have no clue of how to fix it this time.
I ...
47
votes
4
answers
143k
views
Remove rows in python less than a certain value
I feel like this question must have been answered by someone before, but I can't find an answer on stack overflow!
I have a dataframe result that looks like this and I want to remove all the values ...
46
votes
9
answers
111k
views
pandas how to swap or reorder columns
I know that there are ways to swap the column order in python pandas.
Let say I have this example dataset:
import pandas as pd
employee = {'EmployeeID' : [0,1,2],
'FirstName' : ['a','b','c'],
...
45
votes
3
answers
48k
views
Python Pandas: drop a column from a multi-level column index?
I have a multi level column table like this:
a
---+---+---
b | c | f
--+---+---+---
0 | 1 | 2 | 7
1 | 3 | 4 | 9
How can I drop column "c" by name? to look like this:
a
---+---
...
44
votes
6
answers
44k
views
How to drop columns which have same values in all rows via pandas or spark dataframe?
Suppose I've data similar to following:
index id name value value2 value3 data1 val5
0 345 name1 1 99 23 3 66
1 12 name2 1 99 23 2 66
...
41
votes
2
answers
107k
views
Creating a new column in Panda by using lambda function on two existing columns
I am able to add a new column in Panda by defining user function and then using apply. However, I want to do this using lambda; is there a way around?
For example, df has two columns a and b. I want ...
35
votes
12
answers
76k
views
Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead
I am new in Binding and WPF recently I've learned how to create a listBox with multiple columns using Binding tech
<ListView ItemsSource="{Binding Items}" Margin="306,70,22,17" MouseDoubleClick="...
34
votes
1
answer
14k
views
Apply a function to a subset of data.table columns, by column-indices instead of name
I'm trying to apply a function to a group of columns in a large data.table without referring to each one individually.
a <- data.table(
a=as.character(rnorm(5)),
b=as.character(rnorm(5)),
c=...
34
votes
4
answers
140k
views
MySQL ORDER BY multiple column ASC and DESC
I have 2 MYSQL tables, users and scores. Detail:
users table:
scores table:
My intention is get 20 users list that have point field sort DESC (descending) combine avg_time field sort ASC (ascending)...
33
votes
2
answers
88k
views
Set the variable result, from query
When I create the saved procedure, i can create some variable yes? for example:
CREATE PROCEDURE `some_proc` ()
BEGIN
DECLARE some_var INT;
SET some_var = 3;
....
QUESTION: but how to ...
33
votes
4
answers
136k
views
How to make div same height as parent (displayed as table-cell)
I got a container div containing three child divs (vary in content) - each as tall as the tallest one. I managed this by setting the container to display:table and the child divs to display:table-cell ...
32
votes
1
answer
11k
views
Pandas dataframe - running sum with reset
I want to calculate the running sum in a given column(without using loops, of course). The caveat is that I have this other column that specifies when to reset the running sum to the value present in ...
32
votes
5
answers
26k
views
Split a list column into multiple columns
I have a data frame where the last column is a column of lists. Below is how it looks:
Col1 | Col2 | ListCol
--------------------------
na | na | [obj1, obj2]
na | na | [obj1, obj2]
na | na ...
29
votes
2
answers
143k
views
Latex table multiple row and multiple column
I'm trying to create a table in Latex but without success. I tried different solutions but no one solves my problem.
I would like create a table like the picture below:
Can anyone show how to do this ...
28
votes
3
answers
85k
views
Renaming the columns of pandas dataframe is not working as expected
I am having below pandas dataframe df. I am trying to rename the column names but it not working as expected.
Code:
mapping = {df.columns[0]:'Date', df.columns[1]: 'A', df.columns[2]:'B', df....
28
votes
3
answers
15k
views
how to edit text in multiple columns in vim
How can I edit my code in Vim by displaying it in any number of columns?
My laptop and desktop monitors are widescreen (I suspect that is true of most monitors made in the last 5 or 10 years!). When ...
27
votes
8
answers
212k
views
Read CSV file column by column
I want to read specific columns from a multi column csv file and print those columns in other csv file using Java. Any help please? Following is my code to print each token line by line..But I am ...
26
votes
3
answers
63k
views
Multicolumn ListBox in WPF
I have 3 TextBoxes and 1 Button and want to enter each of the the TextBoxes data into a ListBox in separate columns.
I know how to enter data into one column:
listbox1.Items.Add(TextBox1.text);
but ...
26
votes
2
answers
45k
views
R subsetting a data frame into multiple data frames based on multiple column values
I am trying to subset a data frame, where I get multiple data frames based on multiple column values. Here is my example
>df
v1 v2 v3 v4 v5
A Z 1 10 12
D Y 10 12 ...
24
votes
3
answers
48k
views
HTML Table - Both fixed and multiple variable column widths
I have to build a table with 5 columns. The table width is variable (50% of content width). Some columns contain fixed-size buttons, so those columns should have a fixed with, say 100px. Some columns ...
24
votes
13
answers
29k
views
LINQ to Entities - where..in clause with multiple columns
I'm trying to query data of the form with LINQ-to-EF:
class Location {
string Country;
string City;
string Address;
…
}
by looking up a location by the tuple (Country, City, Address)....
23
votes
2
answers
26k
views
ddply + summarize for repeating same statistical function across large number of columns
Ok, second R question in quick succession.
My data:
Timestamp St_01 St_02 ...
1 2008-02-08 00:00:00 26.020 25.840 ...
2 2008-02-08 00:10:00 25.985 25.790 ...
3 2008-02-08 00:20:00 ...
23
votes
2
answers
7k
views
CSS Flex Column Layout without Specified Height
Just discovered flex today and I'm hoping it'll solve a small visual challenge.
I have a list of items already alphabetically sorted. They all have the same width and, up until now, I've had them ...
22
votes
5
answers
45k
views
How to merge/combine columns in pandas?
I have a (example-) dataframe with 4 columns:
data = {'A': ['a', 'b', 'c', 'd', 'e', 'f'],
'B': [42, 52, np.nan, np.nan, np.nan, np.nan],
'C': [np.nan, np.nan, 31, 2, np.nan, np.nan],
'...
21
votes
4
answers
75k
views
Select column 2 to last column in R
I have a data frame with multiple columns. Now, I want to get rid of the row.names column (column 1), and thus I try to select all the other columns.
E.g.,
newdata <- olddata[,2:10]
is there a ...
20
votes
3
answers
81k
views
Using subselect to accomplish LEFT JOIN
Is is possible to accomplish the equivalent of a LEFT JOIN with subselect where multiple columns are required.
Here's what I mean.
SELECT m.*, (SELECT * FROM model WHERE id = m.id LIMIT 1) AS models ...
20
votes
2
answers
81k
views
fixed div inside bootstrap column [closed]
I'm trying to make a two column responsive layout using bootstrap, in the left column I would like to place a menu, and in the right an image gallery. I would like the menu to stay fixed while ...
20
votes
4
answers
25k
views
How to select and delete columns with duplicate name in pandas DataFrame
I have a huge DataFrame, where some columns have the same names. When I try to pick a column that exists twice, (eg del df['col name'] or df2=df['col name']) I get an error. What can I do?
19
votes
2
answers
41k
views
Assign unique ID based on two columns [duplicate]
I have a dataframe (df) that looks like this:
School Student Year
A 10 1999
A 10 2000
A 20 1999
A 20 2000
A 20 2001
B 10 1999
B ...