Question Cagtegory: Numpy
Filter by
Filter by
Questions Per Page:
• ## How to write cell data changed over time into by `vtk.vtkXMLUnstructuredGridWriter`?

I have a triangle mesh, and want to write some cell data which changed over time into test.vtu files. import …

Asked on July 16, 2020 in
• 361 views
• ## how can you retrieve source code in python, inspect gives type error

In order to get better at programming, analysing numpy and scipy’s source code could come in handy. import inspect,numpy as …

Asked on July 16, 2020 in
• 340 views
• ## array([….])is not a callable object. What does this mean in python?

I am writing a python code to create a curve fit o a circle and plot it along with the …

Asked on July 16, 2020 in
• 375 views
• ## How to insert small array into larger array without fully specifying destination slices?

Say we are pasting a smaller image into a larger one. We could do it the normal way, large = …

Asked on July 16, 2020 in
• 355 views
• ## Code only works when it's run line by line in Spyder

I was trying to run a Python script in Spyder, but one line of code (spk_log[cell] = 1) does not …

Asked on July 16, 2020 in
• 357 views
• ## Which fmt option in numpy.savetxt keeps infinite integer precision?

I have been using numpy.savetxt without specifying the fmt option, and sometimes when a particularly large integer is supposed to …

Asked on July 16, 2020 in
• 358 views
• ## Is there a way to vectorize applying the mean function to masked regions in an ndarray?

Let’s say I have a two ndarray define as such: import numpy as np mask = np.array([[1,1],[1,2]]) values = np.array([[1., …

Asked on July 16, 2020 in
• 322 views
• ## logical_not used for 1,0 rather than True, False in boolean array

I want to get the inverse of all components in an array containing a certain number of 0 and 1. …

Asked on July 16, 2020 in
• 343 views
• ## sklearn's imputer reducing columns?

I’m wondering if anyone can help explain a weird behavior I’m seeing with sklearn’s interativeImputer. imputer = IterativeImputer(max_iter=100) print("dateframe shape …

Asked on July 16, 2020 in
• 371 views