Getting Data in Wrong Sequence Order from DynamoDB
<p>I am facing problem in downloading the Data from DynamoDB. I tried with Python SDK as well as with the AWS CLI (aws dynamodb scan --table-name Alarms) but every time, I am getting the same problem. Does anyone have any idea that what is the cause for that.</p>

<p>Output Get</p>

<pre><code>    {
        "FRE": {
            "S": "1"
        },
        "MB": {
            "S": "0"
        },
        "TW": {
            "S": "1"
        },
        "FNB": {
            "S": "0"
        },
        "Date": {
            "S": "2016-10-19 09:04:47.083456"
        },
        "TD2": {
            "S": "1"
        },
        "TD1": {
            "S": "1"
        },
        "TB": {
            "S": "1"
        }
    }
</code></pre>

<p>Output Required</p>

<pre><code>    {
         "Date": {
            "S": "2016-10-19 09:04:47.083456"
        },

        "FRE": {
            "S": "1"
        },
        "MB": {
            "S": "0"
        },
        "TW": {
            "S": "1"
        },
        "FNB": {
            "S": "0"
        },
        "TD2": {
            "S": "1"
        },
        "TD1": {
            "S": "1"
        },
        "TB": {
            "S": "1"
        }
    }
</code></pre>

<p>Thanks
Waqas Ali Khan</p>

<p>When you creating dictionary object, that having problem of to maintain order, it doesn't iterate in order with respect to element added in it.</p>

<pre><code>#So we have to create Ordered dict you can use collection package as follow's 

from collections import OrderedDict
data_dict = OrderedDict() 
</code></pre>

<p>Now, you will maintain order of your directory, in sequence of data added in it. you can able to iterate in order also. </p>

python amazon-web-services amazon-dynamodb