All Questions
Tagged with python-2.7 list
2,996
questions
-3
votes
0
answers
18
views
how can I compute the striking force of a football player using python [closed]
in a football match between England and Spain Julius Fueke needs a decisive goal, write a Python program that can compute the striking force of each of the players
i tried using the import numpy but ...
0
votes
2
answers
67
views
List of lists (double [[) in Python
This is a really basic thing but after reading the documentation I am still not able to do. I just want to create a list of 9 sublists as follows
[[0, 0.05, 0.1, ..., 25],[0, 0.05, 0.1, ..., 25],[0, 0....
0
votes
0
answers
9
views
Getting wrong output while using Monotonic stack to find previous Greater Index in array
I am using Monotonic Stack for finding previous greater indexes for the elements in the list arr. I want to return a list with all the indexes that shows indexes of previous greater element. But for ...
0
votes
1
answer
54
views
Fetching table from Word document including the numbered list
Currently, I possess a code that extracts tables and paragraphs from a Word document. However, it does not encompass the numbered lists within the tables.
For example, if i have 1. Appearance in a ...
1
vote
1
answer
31
views
Python list with multiple 2D list append same value to first row of each value
I have a list like this:
a = [[[0, 1], [1, 1]], [[1, 0], [1, 1]]]
Which means i have two 2D list inside a list:
a[0] = [0, 1], [1, 1]
a[1] = [1, 0], [1, 1]
and i would like to append the ...
0
votes
1
answer
40
views
How can i add the column name in every sheet of excel file in python
I have 6 sheets in my excel file and i need to copy the date from file name and append the same in every sheet as new column as date.but with this code i can change only in first sheet.
import os
...
1
vote
0
answers
19
views
Largest possible subset challenge failing
I am doing the following challenge:
Commander Lambda's space station is HUGE. And huge space stations take a LOT of power. Huge space stations with doomsday devices take even more power. To help meet ...
0
votes
0
answers
388
views
NameError: name 'Task' is not defined
please someone help me to solve this problem
# **Admin.py**
from django.contrib import admin
from .models import Task
admin.site.register(Task)
# **view.py**
from django.shortcuts import render
from ...
0
votes
0
answers
22
views
Tests fail due to presence of long literal in output
A few of my tests have an expected response and an actual response.
The actual is a response from the DB and it's comparing against a manually built list.
The code can be simplified to below:
# List ...
0
votes
1
answer
41
views
map list based on dict internal values
I have a list like:
[{'sample': {'sample_context': {'board': u'9', 'encoder': u'1'}, 18421: u'1191'}}, {'sample': {'sample_context': {'board': u'5', 'encoder': u'1'}, 18422: u'2251'}}, {'sample': {'...
0
votes
2
answers
109
views
User input validation not validating correctly, any suggestions for what I may be doing wrong?
I'm trying to validate user's input with a while loop so that only integers and number's greater than 8 are accepted. The code I have currently runs properly when a string is inputed and prints the ...
0
votes
2
answers
191
views
How do I count the number of common elements in two lists (including duplicates IF in both lists)?
I want to count the number of common elements in two lists, where duplicates are treated separately (i.e. if 'a' is in one list once and the other list twice, it is only counted once, but if it is in ...
-3
votes
1
answer
50
views
Slice a dictionary value from list of dictionaries in Python [closed]
I am trying to append a specific value from my List of Dictionary to another list.
All_Result={'Team Name':[]}
Trying to append
all_result['SupportGroup'].append(issue["fields"]["Team ...
0
votes
1
answer
41
views
Use the numbers from Response.Json() string and pass it as parameters to get requests and loop append the results in Python
I am using the below code to fetch results from rest api. Looping the results and appending the same.
mylog = []
offset = 0
limit = 50
while True:
url = f"https://api.newrelic.com/v2/...
0
votes
1
answer
270
views
UnicodeEncodeError: 'charmap' codec can't encode character '\u03a3' in position 409: character maps to <undefined>
I am running Python code to pull the issues from JIRA. This code is provided by Atlassian and they are using JiraOne Library.
In the Config.Json file we have the following information.
{
"user&...