Questions tagged [row]

A horizontal line of cells in a spreadsheet, SQL table, HTML table, or similar structure.

A row most commonly refers to a horizontal line of cells in a spreadsheet or similar structure.

7733 questions
542
votes
12 answers

jQuery: count number of rows in a table

How do I count the number of tr elements within a table using jQuery? I know there is a similar question, but I just want the total rows.
danjan
503
votes
8 answers

How do I add indexes to MySQL tables?

I've got a very large MySQL table with about 150,000 rows of data. Currently, when I try and run SELECT * FROM table WHERE id = '1'; the code runs fine as the ID field is the primary index. However, for a recent development in the project, I have…
Michael
  • 5,505
  • 4
  • 20
  • 12
347
votes
14 answers

Find row where values for column is maximal in a pandas DataFrame

How can I find the row for which the value of a specific column is maximal? df.max() will give me the maximal value for each column, I don't know how to get the corresponding row.
Miki Tebeka
  • 13,428
  • 4
  • 37
  • 49
307
votes
10 answers

How do I delete rows in a data frame?

I have a data frame named "mydata" that looks like this this: A B C D 1. 5 4 4 4 2. 5 4 4 4 3. 5 4 4 4 4. 5 4 4 4 5. 5 4 4 4 6. 5 4 4 4 7. 5 4 4 4 I'd like to delete row 2,4,6. For example, like this: …
R newbie
  • 3,127
  • 2
  • 13
  • 5
264
votes
8 answers

Pandas dataframe get first row of each group

I have a pandas DataFrame like following: df = pd.DataFrame({'id' : [1,1,1,2,2,3,3,3,3,4,4,5,6,6,6,7,7], 'value' : ["first","second","second","first", "second","first","third","fourth", …
Nilani Algiriyage
  • 32,876
  • 32
  • 87
  • 121
196
votes
13 answers

How to insert a row in an HTML table body in JavaScript

I have an HTML table with a header and a footer: …
Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
195
votes
13 answers

Replacing Header with Top Row

I currently have a dataframe that looks like this: Unnamed: 1 Unnamed: 2 Unnamed: 3 Unnamed: 4 0 Sample Number Group Number Sample Name Group Name 1 1.0 1.0 s_1 g_1 2 2.0 …
Jeremy G
  • 2,189
  • 2
  • 13
  • 14
193
votes
26 answers

In MySQL, can I copy one row to insert into the same table?

insert into table select * from table where primarykey=1 I just want to copy one row to insert into the same table (i.e., I want to duplicate an existing row in the table) but I want to do this without having to list all the columns after the…
lina
  • 1,931
  • 2
  • 12
  • 4
185
votes
20 answers

How to add a new row to datagridview programmatically

if add row to DataTable DataRow row = datatable1.NewRow(); row["column2"]="column2"; row["column6"]="column6"; datatable1.Rows.Add(row); How about DataGridView??
LK Yeung
  • 3,462
  • 5
  • 26
  • 39
179
votes
5 answers

Python pandas: fill a dataframe row by row

The simple task of adding a row to a pandas.DataFrame object seems to be hard to accomplish. There are 3 stackoverflow questions relating to this, none of which give a working answer. Here is what I'm trying to do. I have a DataFrame of which I…
xApple
  • 6,150
  • 9
  • 48
  • 49
162
votes
7 answers

Select random row from a sqlite table

I have a sqlite table with the following schema: CREATE TABLE foo (bar VARCHAR) I'm using this table as storage for a list of strings. How do I select a random row from this table?
Alex_coder
  • 2,308
  • 2
  • 18
  • 15
126
votes
7 answers

Padding a table row

Table Row Padding Issue
My Header
aaaaa
Spencer
  • 4,018
  • 10
  • 33
  • 43
113
votes
7 answers

How to fix height of TR?

Is it possible to fix the height of a row (tr) on a table? The problem appears when I shrink the window of the browser, some rows start playing around, and I can not fix the height of the row. I tried several ways: tr width="20" / tr…
Amra
  • 24,780
  • 27
  • 82
  • 92
98
votes
6 answers

How to align left last row/line in multiple line flexbox

I have a major issue with flexbox layout. I build a container with a boxes filled with images, and i decided to use flexbox layout to justify the content to make it looks like a grid Her's the code:
PuZ
  • 983
  • 1
  • 7
  • 5
94
votes
4 answers

Merge multiple column values into one column in python pandas

I have a pandas data frame like this: Column1 Column2 Column3 Column4 Column5 0 a 1 2 3 4 1 a 3 4 5 2 b 6 7 8 3 c 7 7 What I want to…
sequence_hard
  • 5,115
  • 10
  • 30
  • 50
1
2 3
99 100