# Setting Astropy table column types

**URL:** <https://community.openastronomy.org/t/setting-astropy-table-column-types/498>\
**Category:** Astropy\
**Tags:** astropy, table\
**Created:** [November 3, 2022, 6:42pm UTC](https://community.openastronomy.org/t/setting-astropy-table-column-types/498 "2022-11-03T18:42:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eblur](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/eblur/32/63_2.png) [@eblur](https://community.openastronomy.org/u/eblur)\
**Post date:** [November 3, 2022, 6:42pm UTC](https://community.openastronomy.org/t/setting-astropy-table-column-types/498/1 "2022-11-03T18:42:20Z")

</div>

Is there a way to specify what kind of variable you’re putting in a table? I have a student who is trying to add table values with string 14 but they’re formatting automatically as string 11 (the original format of the table that was read in), so they won’t combine properly.

---

<div class="post-metadata">

**Author:** ![mwcraig](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/mwcraig/32/37_2.png) [@mwcraig](https://community.openastronomy.org/u/mwcraig)\
**Post date:** [November 9, 2022, 3:21pm UTC](https://community.openastronomy.org/t/setting-astropy-table-column-types/498/2 "2022-11-09T15:21:44Z")

</div>

I have hit this in the past too. I think I have either made a brand new column for the data or used the `dtype` or `type` argument (don’t remember which it is called) to make the string type longer. I can try to dig out some example if you want.

---

<div class="post-metadata">

**Author:** ![eblur](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/eblur/32/63_2.png) [@eblur](https://community.openastronomy.org/u/eblur)\
**Post date:** [November 9, 2022, 3:38pm UTC](https://community.openastronomy.org/t/setting-astropy-table-column-types/498/3 "2022-11-09T15:38:52Z")

</div>

We ended up creating a new Astropy table with a fake entry in the column we needed to be a longer string, e.g., ‘123456789101112’, to force the type to be longer. Then we just deleted that row later. 😆 😅
