# \[데이터] 데이터셋에서 특정 속성만 가져오기

### 코드

```
@데이터 "데이터셋_이름"에서 "특정_속성"만 가져오기
```

***

### 설명

데이터 전체에서 특정 속성만 추출할 때 사용해요. 분석 전에 필요한 속성만 선택해 가볍게 처리할 수 있어요.

***

### 주의사항

* 속성  이름에 오탈자가 있으면 결과가 비거나 오류가 날 수 있어요.
* 단일 속성만 가져오므로 다른 컬럼 정보는 포함되지 않아요.
* 원본 데이터는 바뀌지 않고 추출 결과만 새로 만들어져요.

***

### 파이썬 대응 코드

```
selected = df[[column_name]] # 또는 df[column_name]
```

***

### 예시

{% code title="예시 코드" %}

```
인구데이터 = @데이터 "2022~2050 추계 인구" 불러오기
인구예측 = @데이터 인구데이터 에서 "총인구"만 가져오기
인구예측 보여주기
```

{% endcode %}

{% code title="예시 코드의 결과" %}

```
[51672569, 51712619, 51751065, 51684564, 51609121, 51534551, 51459877, 51384052, 51305713, 51223269, 51135265, 51040632, 50937726, 50824868, 50701389, 50567057, 50417167, 50247657, 50059218, 49851637, 49625415, 49380766, 49117432, 48835031, 48532231, 48208374, 47863071, 47495914, 47106960]
```

{% endcode %}

***

### 검색 키워드

속성 추출, 열 선택, 속성 선택, 열 추출


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codebook.horang.it/data/undefined-1-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
