# How to change field names and types of a DataFrame

**URL:** <https://discourse.julialang.org/t/how-to-change-field-names-and-types-of-a-dataframe/43991>\
**Category:** Data\
**Tags:** question\
**Created:** [July 30, 2020, 4:46pm UTC](https://discourse.julialang.org/t/how-to-change-field-names-and-types-of-a-dataframe/43991 "2020-07-30T16:46:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [July 30, 2020, 5:27pm UTC](https://discourse.julialang.org/t/how-to-change-field-names-and-types-of-a-dataframe/43991/2 "2020-07-30T17:27:22Z")

</div>

Someting like

```julia
df[!, :x2] = convert.(Int, df[:, :x2])

```

will change types types. Note the `!` and `:`. See

> [@DataFrames: convert column data type](https://discourse.julialang.org/t/dataframes-convert-column-data-type/35522):
>
> Was looking around, but didn’t find an answer. Specifically, I have a DataFrame and one column has data type Int64; it has the unique values 0 and 1 (meaning obviously false and true). What is the easiest quickest way to have the column including its entries converted to the boolean data type? I thought about a kind of loop, but are there already existing functions available that I should know of? More generally, please explain how to best tackle this (especially conceptually), if using a se…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-change-field-names-and-types-of-a-dataframe/43991)._
