py tag

191 questions


1 answers
68 views
0
Understanding the Rewrite of Elements in a List Using the for and if statements

I'm a beginner, so I'm sorry if I don't know how to ask questions.I'm trying to create a matrix in Python 3 and write a code that replaces the elements in the matrix with input results.It was possible...

2 years ago

1 answers
51 views
0
How to Replace Elements of a Numpy Array with an Array

I can't think of a way to replace the np.array element with np.array.For example: Before Run img=np.array([ [0, 1, 2], [2, 1, 1],])For example, the value of img[h,w] is img[h,w]==0 np.array([255,0,0]...

2 years ago

1 answers
128 views
0
Isn't there a sumif, countif function like Excel in the Numpy array?

I am looking for sumif, countif functions like calculating the python3 array Excel.If you know this, please give us your advice.

2 years ago

1 answers
53 views
0
You can find the following list data, and you can also find the dictionary type data in the column.I'd like to convert this into the following form, but I don't know how to do it.

We have now extracted the following form of list data. [['A(S)''B(M)'] ['1234' '{ voltage: {name: {S: R00070}, button: {L: [{N:29}, {N:0}}'] ['5678' '{ voltage: {name: {S: R00080}, button: {L: [{N:30}...

2 years ago

1 answers
129 views
0
How to Choose a Multi-Dimensional Array in Python

I am using Python 3.6.when np.array gives the array and range belowarr[a][b][c][d]a--1 to 72b--0 to 11c--0 to 9d--0 to 4500I'd like to substitute arr1 in this way.arr1 = arr [All (1-72)] [One from 12]...

2 years ago

1 answers
92 views
0
treat the path of the tkinter dialog file as an argument

You are currently opening a dialog using tkinter.I got the file path, but I would like to replace it with f1, f2.What should I do?import matplotlib.pyplot as pltimport numpy as npimportosimport tkinte...

2 years ago

1 answers
64 views
0
I want to calculate the angle between the two vectors by considering the direction of the vector with numpy.

First, do the following:Write a function that calculates the angle between the vector x and the vector y.import numpy as npdefault(x,y): dot_xy=np.dot(x,y) norm_x = np.linalg.norm(x) norm_y = np.linal...

2 years ago

1 answers
55 views
0
I don't know why the syntax is different when I take out a part of the list.

I wrote the following code:dy[0][0:1] failed to retrieve the first number in the list, so dy_sum can be shaped once and dy_sum[0:1] can retrieve the first number in the list, but for some reason dx[0]...

2 years ago

3 answers
63 views
0
Differences between standard random modules and numpy.random

I'd like to use python to generate random numbers, but I checked and found that there is a way to use the standard random module and numpy.random. What is the difference between the random number gene...

2 years ago

1 answers
54 views
0
Understanding Slash and Subsequent Meaning in the Numpy Reference Function Arguments

Thank you for your help.I have a question about the title.Describes the meaning of the reference sin function argument in numpy v1.15.https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy....

2 years ago
« - 7 - »

© 2024 OneMinuteCode. All rights reserved.