# Selecting the value in a particular row of a column in a DataFrame

**URL:** https://discourse.julialang.org/t/selecting-the-value-in-a-particular-row-of-a-column-in-a-dataframe/42961
**Category:** New to Julia
**Created:** [July 12, 2020, 8:51pm UTC](https://discourse.julialang.org/t/selecting-the-value-in-a-particular-row-of-a-column-in-a-dataframe/42961 "2020-07-12T20:51:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)
#### Post date: [July 12, 2020, 8:51pm UTC](https://discourse.julialang.org/t/selecting-the-value-in-a-particular-row-of-a-column-in-a-dataframe/42961/1 "2020-07-12T20:51:13Z")

</div>

The following selects an entire column in a DataFrame:

```
select(df,:x)

```

But how do I select the second row of x, say?

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [July 12, 2020, 9:02pm UTC](https://discourse.julialang.org/t/selecting-the-value-in-a-particular-row-of-a-column-in-a-dataframe/42961/2 "2020-07-12T21:02:13Z")

</div>

`select(df, :x)`. That doesn’t select the column, it makes a new `DataFrame` with only one column `:x`. i.e. it doesn’t return the array `df.x`.

For the vector you want

```julia
df.x # doesn't copy the column
df[!, :x] # doesn't copy the column
df[:, :x] # copies the column

```

For the second element you want

```julia
df[2, :x]
df.x[2]

```
