json_split = {}
value = {"Status": "Submitted", "m_Controller": "Python"}
a = range(31)
del a[0]
for i in a:
json_split[i] = value
keys = json_split.keys()
order = list(keys)
q1 = int(round(len(keys)*0.2))
q2 = int(round(len(keys)*0.3))
q3 = int(round(len(keys)*0.5))
b = [q1,q2,q3]
n=0
threedic
Anurag Patibandla Wrote in message:
> On Wednesday, October 15, 2014 1:35:43 PM UTC-4, Rustom Mody wrote:
>> On Wednesday, October 15, 2014 10:51:11 PM UTC+5:30, Anurag Patibandla wrote:
>>
>> > Here is my sample dict if that helps:
>>
>> >
>>
>> >
>>
>> >
>>
>> > json = {"1": {"Status": "
On Wednesday, October 15, 2014 1:41:13 PM UTC-4, Dave Angel wrote:
> Anurag Patibandla Wrote in message:
>
> > Thanks for the response.
>
> > Here is the code that I have tried.
>
> >
>
> > from operator import itemgetter
>
> > keys = json.keys()
>
> > order = list(keys)
>
> > q1 = int(rou
On Wednesday, October 15, 2014 1:35:43 PM UTC-4, Rustom Mody wrote:
> On Wednesday, October 15, 2014 10:51:11 PM UTC+5:30, Anurag Patibandla wrote:
>
> > Here is my sample dict if that helps:
>
> >
>
> >
>
> >
>
> > json = {"1": {"Status": "Submitted", "Startdate": ["01/01/2011"],
> > "End
Anurag Patibandla Wrote in message:
> dicts = dict(lists)
> print dicts
> print dict[0]
>
> Print dicts works as expected giving me the combine dictionary values. But
> when I say dict[0]. I see the error:
> TypeError: 'type' object has no attribute '__getitem__'
>
Of course. You
Anurag Patibandla Wrote in message:
> On Wednesday, October 15, 2014 1:10:41 PM UTC-4, Rustom Mody wrote:
>> On Wednesday, October 15, 2014 10:30:49 PM UTC+5:30, Anurag Patibandla wrote:
>>
>> > keys = json.keys()
>>
>> > order = list(keys)
>>
>> > q1 = int(round(len(keys)*0.2))
>>
>> > q2 = i
Anurag Patibandla Wrote in message:
> Thanks for the response.
> Here is the code that I have tried.
>
> from operator import itemgetter
> keys = json.keys()
> order = list(keys)
> q1 = int(round(len(keys)*0.2))
> q2 = int(round(len(keys)*0.3))
> q3 = int(round(len(keys)*0.5))
> b = [q1,q2,q3]
>
On Wednesday, October 15, 2014 10:51:11 PM UTC+5:30, Anurag Patibandla wrote:
> Here is my sample dict if that helps:
>
>
>
> json = {"1": {"Status": "Submitted", "Startdate": ["01/01/2011"], "Enddate":
> ["02/02/2012"], "Job_ID": 1, "m_Quantile": "80", "m_Controller": "Python",
> "m_Method":
Here is my sample dict if that helps:
json = {"1": {"Status": "Submitted", "Startdate": ["01/01/2011"], "Enddate":
["02/02/2012"], "Job_ID": 1, "m_Quantile": "80", "m_Controller": "Python",
"m_Method": "Distributed", "Allocation_3": ["50"], "Allocation_2": ["30"],
"Allocation_1": ["20"], "Note"
On Wednesday, October 15, 2014 1:10:41 PM UTC-4, Rustom Mody wrote:
> On Wednesday, October 15, 2014 10:30:49 PM UTC+5:30, Anurag Patibandla wrote:
>
> > keys = json.keys()
>
> > order = list(keys)
>
> > q1 = int(round(len(keys)*0.2))
>
> > q2 = int(round(len(keys)*0.3))
>
> > q3 = int(round(l
On Wednesday, October 15, 2014 10:30:49 PM UTC+5:30, Anurag Patibandla wrote:
> keys = json.keys()
> order = list(keys)
> q1 = int(round(len(keys)*0.2))
> q2 = int(round(len(keys)*0.3))
> q3 = int(round(len(keys)*0.5))
> b = [q1,q2,q3]
> n=0
> for i in b:
> queues = order[n:n+i]
> n = n+i
keys = json.keys()
order = list(keys)
q1 = int(round(len(keys)*0.2))
q2 = int(round(len(keys)*0.3))
q3 = int(round(len(keys)*0.5))
b = [q1,q2,q3]
n=0
for i in b:
queues = order[n:n+i]
n = n+i
lists = [(queues[j], json.get(queues[j])) for j in range(len(queues))]
dicts
On Wednesday, October 15, 2014 10:13:18 PM UTC+5:30, Rustom Mody wrote:
> On Wednesday, October 15, 2014 9:58:49 PM UTC+5:30, Anurag Patibandla wrote:
> > First the values printed by
> > '[(queues[j], json.get(queues[j])) for j in range(len(queues))] '
> > is a list, so I tried to convert it into a
keys = json.keys()
order = list(keys)
q1 = int(round(len(keys)*0.2))
q2 = int(round(len(keys)*0.3))
q3 = int(round(len(keys)*0.5))
b = [q1,q2,q3]
n=0
for i in b:
queues = order[n:n+i]
n = n+i
#print queues
#print [(queues[j], json.get(queues[j])) for j in range(len(queues))
On Wednesday, October 15, 2014 9:58:49 PM UTC+5:30, Anurag Patibandla wrote:
> First the values printed by
> '[(queues[j], json.get(queues[j])) for j in range(len(queues))] '
> is a list, so I tried to convert it into a dict using dict().
> And then I tried doing dict[0] but there is an error which
First the values printed by
'[(queues[j], json.get(queues[j])) for j in range(len(queues))] '
is a list, so I tried to convert it into a dict using dict().
And then I tried doing dict[0] but there is an error which says:
'type' object has no attribute '__getitem__'
--
https://mail.python.org/mail
On Wednesday, October 15, 2014 9:22:48 PM UTC+5:30, Anurag Patibandla wrote:
> Thanks Rustom for the advice.
> I am new to Python and getting struck at some basic things. How do I assign
> the values that I am printing to 3 variables say dict1, dict2, dict3?
> When I try to assign them before the
Thanks Rustom for the advice.
I am new to Python and getting struck at some basic things. How do I assign the
values that I am printing to 3 variables say dict1, dict2, dict3?
When I try to assign them before the print statement like this:
d1, d2, d3 =[(queues[j], json.get(queues[j])) for j in ran
On Wednesday, October 15, 2014 9:10:54 AM UTC+5:30, Anurag Patibandla wrote:
> Thanks for the response.
> Here is the code that I have tried.
> from operator import itemgetter
> keys = json.keys()
> order = list(keys)
> q1 = int(round(len(keys)*0.2))
> q2 = int(round(len(keys)*0.3))
> q3 = int(rou
'json' has my original larger dict
--
https://mail.python.org/mailman/listinfo/python-list
Thanks for the response.
Here is the code that I have tried.
from operator import itemgetter
keys = json.keys()
order = list(keys)
q1 = int(round(len(keys)*0.2))
q2 = int(round(len(keys)*0.3))
q3 = int(round(len(keys)*0.5))
b = [q1,q2,q3]
n=0
for i in b:
queues = order[n:n+i]
n =
On Wednesday, October 15, 2014 7:35:18 AM UTC+5:30, Dave Angel wrote:
> anurag Wrote in message:
> > I have a dictionary that looks like this:
> > {"1":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"},
> > "2":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"},
> > "3":{"Key1":"Value1", "Key2
On 2014-10-14 22:15, Anurag Patibandla wrote:
On Tuesday, October 14, 2014 12:59:27 PM UTC-4, Dave Angel wrote:
anuragpatiband...@gmail.com Wrote in message:
> I have a dictionary that looks like this:
> {"1":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"},
> "2":{"Key1":"Value1", "Key2":"V
On Tuesday, October 14, 2014 5:33:01 PM UTC-4, Skip Montanaro wrote:
> Shuffle the keys, then grab the first 20 for one dictionary, the next 30 for
> the second, and the last 50 for the third.
>
> Skip
Could you please be more specific?
--
https://mail.python.org/mailman/listinfo/python-list
Shuffle the keys, then grab the first 20 for one dictionary, the next 30
for the second, and the last 50 for the third.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
On Tuesday, October 14, 2014 12:59:27 PM UTC-4, Dave Angel wrote:
> anuragpatiband...@gmail.com Wrote in message:
>
> > I have a dictionary that looks like this:
>
> > {"1":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"},
>
> > "2":{"Key1":"Value1", "Key2":"Value2", "Key3":"Value3"},
>
>
26 matches
Mail list logo