# How to convert this association list

**URL:** <https://community.wolfram.com/t/how-to-convert-this-association-list/24344>\
**Category:** Questions\
**Tags:** data-science\
**Created:** [July 22, 2024, 1:27am UTC](https://community.wolfram.com/t/how-to-convert-this-association-list/24344 "2024-07-22T01:27:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmhh9020](https://avatars.discourse-cdn.com/v4/letter/h/46a35a/32.png) [@hmhh9020](https://community.wolfram.com/u/hmhh9020)\
**Post date:** [July 22, 2024, 1:27am UTC](https://community.wolfram.com/t/how-to-convert-this-association-list/24344/1 "2024-07-22T01:27:42Z")

</div>

How do you convert the list in goldMedals

 ![Screenshot2024-07-21at8.24.48 PM.png](https://global.discourse-cdn.com/wolfram/original/3X/0/5/059ad8cbdd9b9d63db1a483ae303325d151c2d9c.png)

to this one in the code below

 ![Screenshot2024-07-21at8.25.56 PM.png](https://global.discourse-cdn.com/wolfram/original/3X/0/1/0116ebe86818775f5b674bc9b3b11fca58798dcb.png)

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [July 22, 2024, 12:45pm UTC](https://community.wolfram.com/t/how-to-convert-this-association-list/24344/2 "2024-07-22T12:45:25Z")

</div>

Welcome to Wolfram Community! Please make sure you know the rules: [https://wolfr.am/READ-1ST](https://wolfr.am/READ-1ST)

The rules explain how to format your code properly. Posting code Images doesn’t help other members to copy your code. Please **EDIT** your post and make sure code blocks start on a new paragraph and look framed and colored like this.

```
int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

```

You can also embed notebook or attach notebook.

 ![Editor_WC_3.png](https://global.discourse-cdn.com/wolfram/original/2X/7/7bf045a0ac3b80bb1001ef8ca9b41d21ad36528c.png)

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [July 22, 2024, 4:00pm UTC](https://community.wolfram.com/t/how-to-convert-this-association-list/24344/3 "2024-07-22T16:00:59Z")

</div>

If there’s no simple rule for splitting the given association, then the simplest way might be to edit it by hand. At a glance, the order of entries seems the same in both codes. If so, you could just paste `|>, <|` at the appropriate junctures.

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [July 22, 2024, 5:07pm UTC](https://community.wolfram.com/t/how-to-convert-this-association-list/24344/4 "2024-07-22T17:07:06Z")

</div>

goldMedals = \<|“USA” → 39, “China” → 38, “Japan” → 27|\>;

```
listOfAssociations = Map[Association, Normal@goldMedals]

BarChart[listOfAssociations,ChartLayout->"Stacked",ChartLabels->Automatic]

```
