2

answersEverywhere it is written that the NumPy arrays are faster and more efficient than lists. Why this is so, they have some kind of more optimal implementation or write, due to the fact that arrays have many useful and convenient features that are effectively written?

asked April 18th 20 at 12:17

1

answerColleagues, kind time of day!
Interested in the following:
I get from DB df $ 10 million rows by n columns;
Then choose from this df one column;
Make a copy of it consists of the inverse values;
Received a copy of the make line;
Then multiply by matrix method using np.dot()column on the generated string.
-------------------...

asked April 9th 20 at 10:31

1

answerHello, solve the problem of drawing the fractal,namely the Gosper curve, has the following methods:
class turtle:
def __init__(self):
self._direction = np.array([1, 0]) # 2D direction vector
self._position = np.array([0, 0]) # the 2D position vector
def forward(self):
pos = self._position
dirn = self._direction
self....

asked April 9th 20 at 10:24

1

answerThere is an array of the following form:
(items in red are the largest elements whose indexes have to)
That is, for such a array the code should return something like this:
(0, 2, 2), (1, 0, 1), (2, 1, 0), (3, 0, 0), (4, 0, 0)
Of course you can do a cycle with np.argmax, but maybe someone will be able to find a more effe...

asked April 9th 20 at 10:07

1

answerGood day,
Faced with such a situation: a bunch of articles on how to using python to connect to Oracle (cx_Oracle) to get data from a DB and then how to add back to the database data — the answer is not found. All the calculations I gather in the format of pd.DataFrame
Please help if anyone solved a similar problem or hav...

asked April 8th 20 at 18:01

1

answerThat's why this piece of code
tpl=('07f29c2c-9bd2-4999-b69c-a17d15a90700', datetime.datetime(2019, 8, 18, 0, 0), datetime.datetime(2019, 8, 18, 13, 3, 56),
datetime.timedelta(seconds=31), datetime.datetime(2019, 8, 18, 13, 4, 27), 57)
dt = np.dtype([('v2m_guid', str, 36), ('start_date', 'datetime64[ns]'), ('start_time', '...

asked April 8th 20 at 10:16

1

answerthere is a two-dimensional array
0.0, 1
1.0, 2
2.0, 3
2.5, 4
How to get the vector-column, consisting of the derivative of the second column to the first?
0
1
1
2
Or
1
1
2

asked April 8th 20 at 10:14

1

answerI have this problem:
I need to go to class to pass one-dimensional array with numbers, and class should be created in a single numpy array many arrays, how many items and one-dimensional which we passed, and with the dimension of each element as quickly as possible. Example:
class Net():
def __init__(self, input_list):
se...

asked April 7th 20 at 11:47

1

answerTrying to rewrite this article:
Machine learning only began to study, hence the following question arises: How to build a grid of angles and bring it through PyCharm? I am at this stage:
import numpy as np
import math
import matplotlib.pyplot as plt
width = 100
height = 100
left_x = int(width * -0.5)
right_x = int(width...

asked April 7th 20 at 11:13

1

answerThere are 2 single 2d array with the x-mi the other with y-mi lines. For example, x=np.array([[1,2,3], [4,5,6]]) y=np.array([[11,22,33], [44,55,66]]), how to render as fast as possible

asked April 7th 20 at 09:35