Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
When I run
print(c)
I get the output
[45]
How do I remove the [ ] and get output like this as an integer?
45
Because I want to print this but It won't run.
print(b[c:c+50])
Take the first element of that array.
print(c[0])
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 days ago.
Improve this question
multi inputs in python
write a program to take X and Y as input and out put the string x ,repeated y times.
sample input
hi
3
sample output
hi hi hi
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 months ago.
Improve this question
From here I want to print the 3rd highest value along with the 'Id'. A help would be appreciated
Most_Calori_Burner.nlargest(3)
TRy this,
df.groupby('Id')['Calories'].sum().sort_values(ascending=False).reset_index().iloc[2]
Sort your dataframe in descending order
Reset index and take 3rd value.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
Im wondering if somebody could please explain to me why does the left side not work but right side does? Why does assigning the radiuses to variables first produce the wrong calculation in the end?
Look at line 9 of each of the two codes you posted. On the left side, you are doing 26 / 2, whereas on the right side you do 36 / 2 …
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I wanted to calculate this mathematical expression in python3:
Xi = (70 + 1344736401384689745317259585614247891453883777111/315)% 115792089210356248762697446949407573529996955224135760342422259061068512044369
But I'm getting this wrong result: 4.2690044488402846e+45 . Is there something wrong in the expression? how can I fix it to give me the right result?
I think you might be confused because it is showing scientific notation? '{}'.format() should help in that case.
Xi = (70 + 1344736401384689745317259585614247891453883777111/315)% 115792089210356248762697446949407573529996955224135760342422259061068512044369
print('{0:f}'.format(Xi))
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Given this dictionary:
my_dict={'animal':['Dog','Cat'],'age':[4,5],'bark':[True,False],'badge_num':['234','896']}
what code will cast 'age' to float?
you could use map combined with float like the following:
my_dict['age']=list(map(float, my_dict['age']))