Tagged Questions
0
votes
0answers
10 views
Difficulty in selection specific row and merge with specific column
I have a text file which i have a data like this
Textfile1
?Cricket|Batsman|EK
Batsman play cricket for batting
?Cricket|Football|E9
Sequence unavailable
?Cricket|Hockey|EN
Sequence unavailable
I ...
0
votes
2answers
30 views
Making a CSV list in Python
I am new to python and need help. I am trying to make a list of comma separated values.
I have this data.
EasternMountain 84,844 39,754 24,509 286 16,571 3,409 315
EasternHill 346,373 166,917 ...
0
votes
1answer
20 views
Python timer in math game Tkinter
I'm looking to add a timer for my simple math game. So far everything works just fine, the user gets questions when pressing the button and is given feedback on the answer. I want to add a timer for ...
1
vote
2answers
54 views
python:the way strings exist in memory [duplicate]
If strings stay in memory in a normal way,How to explain this case?
s1=';;'
s2=';;'
s1==s2,s1 is s2
(True, False)
s1=';'
s2=';'
s1==s2,s1 is s2
(True, True)
0
votes
1answer
39 views
why is there more than 1 ball and how can i fix it?
hello i am pretty new to programming with pygame and i have this code:
import sys, pygame
pygame.init()
screen = pygame.display.set_mode((800, 368))
background = pygame.image.load("background.png")
...
-1
votes
1answer
21 views
NameError: name 'speed' is not defined [on hold]
hello i am a little bit new with pygame and i have write this code:
import sys, pygame
pygame.init()
screen = pygame.display.set_mode((800, 368))
background = pygame.image.load("background.png")
...
2
votes
2answers
67 views
is keyword in Python [duplicate]
When I read "Learning Python", I'm confused about using the is operator.
The book tries to explain it as a test for the same memory address (A is B, if True, means A and B are in the same memory ...
0
votes
4answers
51 views
Taking Input from a Function Name in Python
I am attempting to write a program to perform arithmetic mod n, given n. I was wondering if there is any way within Python (preferably 2.7) to dynamically define a function such that its behavior ...
0
votes
1answer
35 views
How to cat string with list objects? [duplicate]
I have a string which I want to concatenate with every object within a list. Here is an example:
a = ['1','2']
b = 'a'
and I want:
c = ['a1','a2']
It seems that strings can't be concatenated to ...
0
votes
1answer
31 views
python appending items in a dictionary with for loop
I am writing a nested for loop to judge if two words are similar in pronunciation. My code is like below:
wordsDict = nltk.defaultdict(list)
for s1 in prondict[word1]:
for s2 in prondict[word2]:
...
0
votes
2answers
45 views
Pick values only below a certain threshold
Say I have a number of values: (left column is just the value count: 1,2,3, etc; right are the actual values)
1 5.2
2 1.43
3 3.54
4 887
5 0.35
What I want to do is reorder the values from ...
1
vote
3answers
18 views
Text Based RPG Functioning Error?
So, I'm hard at work on a text-based RPG game on Python 2.7, but I came across a problem in the character menu. Here's what it looks like:
def raceselect(n):
if n==0:
...
0
votes
0answers
43 views
How to serve filetype object in python
I'm using the URLLib2 method to download a file from another server via a rest api (the url can't be exposed to the user--that's why it needs to be done on the backend).
It gives me the following ...
1
vote
0answers
19 views
Complete a task during certain time frames within a python script
As you can see below here is a copy of my script what I've created, could someone help me improve/fix my currenttime tasks.
Basically, during the day periodically calls test every 3 mins +- 60 ...
3
votes
1answer
26 views
Pandas Dataframe Mask based on index
I have the following dataframe:
import pandas as pd
index = pd.date_range('2013-1-1',periods=10,freq='15Min')
data = pd.DataFrame(data=[1,2,3,4,5,6,7,8,9,0], columns=['value'], index=index)
How can ...