• Register

Recent questions tagged numpy

0 votes
1 answer 10 views
0 votes
1 answer 14 views
Problems I am trying to update selected datetime64 values in a pandas data frame using the loc method to select rows satisfying a condition. However, instead of assigning the new date-time value it results in NaT. Here is a simplification of my code that shows the problem: ... as the second element in the new_date column. Any ideas on how this should be done or why this is not working as intended?
asked Sep 15 Marivoke 530 points
0 votes
1 answer 152 views
Problem: I have currently started learning about using the pandas in ipython notebook: import pandas as pd But I have encountered the below error on my above line of code: AttributeError  Traceback (most recent call last) <ipython-input-17-c7ecb2b0a99d> in <module>() ----> 1 from ... ' I have no knowledge on how to fix the above error, what is a problem here? My python's version is currently 3.6
asked Aug 10 Raphael Pacheco 4.9k points
1 vote
1 answer 10 views
Problem: Hello Kodlogs, I am currently working with the NumPy in Python. Already solved some geometrical problems. Now, I am wondering, if I can make a Python program to create a line of best fit for a straight line! I would appreciate it if you could help me in this regard. Note: I am using Python-3.7
asked Aug 6 adamSw 11.3k points
1 vote
1 answer 15 views
Problem: Hello Kodlogs, I am a new student in Python. Previously I used to develop programs in Java. I just installed a fresh Python on my machine. A lot of things to know and learn in Python, and for that, I joined this forum. I found the forum very helpful with a lot of ... same thing, but I want to do it in a NumPy program. How do you do it? Could you please share me the tip? Thanks in advance.
asked Jun 30 adamSw 11.3k points
1 vote
1 answer 11 views
Problem: Hello Kodlogs, Being a newbie I have a question regarding NumPy in Python. I want to square an array&rsquo;s value using the NumPy. Anyway, I can make such a program using normal iteration over an array. I&rsquo;ve googled the problem and found some solution where people ... square(list): return [i ** 2 for i in list] I am eagerly waiting for your answers. Thanks for your kind concern.
asked Jun 27 adamSw 11.3k points
1 vote
1 answer 12 views
Problem: Hello Kodlogs, I was trying to perform some mathematical operation like finding minimum, maximum, average e.t.c. from an array. I can do it using the simple method; adding all the all elements and then divide it by the number of elements. I want to make a ... with less line of codes. Could any of you please give me an example of that type of pram? I will appreciate your help. Thanks.
asked Jun 25 adamSw 11.3k points
1 vote
1 answer 33 views
Problem: Yesterday I uninstalled Anaconda and shut down my computer. Right now, I&rsquo;ve freshly installed the Anaconda again on my laptop to run a project. Suddenly, I am facing an ImportError to run a python project. ImportError: Missing required dependencies ['numpy'] ... but it produces the same error again and again. Do you have any clear idea about this problem and how to solve it?
asked Jun 20 adamSw 11.3k points
0 votes
1 answer 399 views
Problem: Recently I have joined new project on python and numpy. My below code is returning me below error: Attributeerror: 'numpy.ndarray' object has no attribute 'append' . Please find my code below for the reference: class1 = np.array([]) #It creates 2 ... to print my results in the scatter graphic with the two colors where I can try to identify the visually the class1 and class2 elements.
asked Jun 17 Raphael Pacheco 4.9k points
2 votes
2 answers 366 views
Problem: I wrote the following code in python using numpy. But it gives me some error message. The code I wrote is: import numpy as np arrayone = np.array(['Human', 'Birds', 'Groots', 'Oats']) arraytwo = np.array(['Beach', 'Toast']) arraythree ... concatenate TypeError: only integer scalar arrays can be converted to a scalar index Can anyone sort out this error and solve this. Thanks in advance.
asked May 6 samhaz 5k points
1 vote
2 answers 312 views
Problem : I am beginner to Ancaconda3 and Tensorflow. I have also recently installed Ancaconda3 and Tensorflow. But if I try to import the Tensorflow in the python shell then I often face the below error: ModuleNotFoundError: No module named 'numpy.core._multiarray_umath ... also installed on my box and it can be very successfully imported in the python. Please note currently I am using Windows10.
asked Apr 22 stewart 4k points
1 vote
1 answer 2K views
Problem: I have a text file that contains a matrix of [2][2] and I am trying to open it in my python program and store the values as integers in a variable. Further, I tried to add some more operations with those values. For better understanding you may check my ... is the solid reason behind it, and how can I fix the error? Please help to get rid of this. I appreciate your concern. Thanks.
asked Apr 21 Gavin 15.3k points
1 vote
2 answers 173 views
Problem: Hello guys, Well, I am working with a NumPy array after learning the array a little bit. I am trying to print a particular element from each row from a two-dimensional array. While I am trying to run the program it returns an error Indexerror: too many indices for ... ;s wrong with this and how may I get rid of this? I am looking forward to hearing back from you guys. Thanks a lot.
asked Apr 21 Gavin 15.3k points
1 vote
2 answers 208 views
Problem : I am beginner to numpy. I am trying to execute my code but I am facing below error. &ldquo;Valueerror: all the input arrays must have same number of dimensions&rdquo;. I want to have my all the arrays with a same shape. I am trying to fix above error from past couple of days but still unable to fix it. I am looking for some help in fixing above error.
asked Apr 4 morrisBson 3.2k points
1 vote
1 answer 349 views
Problem : I am new to the Python programming. I am facing below error while trying to execute my code. File "C:\Users\Anaconda3\lib\site-packages\keras\engine\training_arrays.py", line 217, in fit_loop callbacks.on_epoch_end(epoch, epoch_logs) File "C:\Users\Anaconda3\ ... trying to fix this error since yesterday but I am unable to fix it. Can somebody help me in fixing the above mentioned error?
asked Mar 26 morrisBson 3.2k points
0 votes
1 answer 292 views
I was trying to write a programm using numpy and matplotlib. I am new to python programming. The code I wrote is: import numpy import matplotlib.pyplot def ThisFunction(a): return numpy.int(a) a = numpy.arange(3, 13.5, 0.7) matplotlib.pyplot.plot(a, ... 4, in ThisFunction return numpy.int(a) TypeError: only size-1 arrays can be converted to Python scalars how can I solve this problem?
asked Mar 15 LizzyM 6.1k points