Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

numpy

Split (explode) pandas dataframe string entry to separate rows

August 22, 2022 by Magenaut

I have a pandas dataframe in which one column of text strings contains comma-separated values. I want to split each CSV field and create a new row per entry (assume that CSV are clean and need only be split on ‘,’). For example, a should become b:

Categories Python, Q&A Tags dataframe, numpy, pandas, python Leave a comment

Find unique rows in numpy.array

August 22, 2022 by Magenaut

I need to find unique rows in a numpy.array.

Categories Python, Q&A Tags arrays, numpy, python, unique Leave a comment

pandas create new column based on values from other columns / apply a function of multiple columns, row-wise

August 22, 2022 by Magenaut

I want to apply my custom function (it uses an if-else ladder) to these six columns (ERI_Hispanic, ERI_AmerInd_AKNatv, ERI_Asian, ERI_Black_Afr.Amer, ERI_HI_PacIsl, ERI_White) in each row of my dataframe.

Categories Python, Q&A Tags apply, numpy, pandas, python Leave a comment

Taking subarrays from numpy array with given stride/stepsize

August 22, 2022 by Magenaut

Lets say I have a Python Numpy array a.

Categories Python, Q&A Tags numpy, python, vectorization Leave a comment

How do you fix “runtimeError: package fails to pass a sanity check” for numpy and pandas?

August 21, 2022 by Magenaut

This is the error I am getting and, as far as I can tell, there is nothing useful on the error link to fix this.

Categories Python, Q&A Tags numpy, python, python-3.x, windows Leave a comment

How to pretty-print a numpy.array without scientific notation and with given precision?

August 21, 2022 by Magenaut

I’m curious, whether there is any way to print formatted numpy.arrays, e.g., in a way similar to this:

Categories Python, Q&A Tags numpy, pretty-print, python, python-2.x Leave a comment

What are the advantages of NumPy over regular Python lists?

August 21, 2022 by Magenaut

What are the advantages of NumPy over regular Python lists?

Categories Python, Q&A Tags arrays, list, numpy, numpy-ndarray, python Leave a comment

Cartesian product of x and y array points into single array of 2D points

August 21, 2022 by Magenaut

I have two numpy arrays that define the x and y axes of a grid. For example:

Categories Python, Q&A Tags cartesian-product, numpy, python Leave a comment

Using numpy to build an array of all combinations of two arrays

August 21, 2022 by Magenaut

I’m trying to run over the parameters space of a 6 parameter function to study its numerical behavior before trying to do anything complex with it, so I’m searching for an efficient way to do this.

Categories Python, Q&A Tags arrays, cartesian-product, multidimensional-array, numpy, python Leave a comment

ValueError: setting an array element with a sequence

August 21, 2022 by Magenaut

This Python code:

Categories Python, Q&A Tags arrays, numpy, python, slice Leave a comment
Older posts
Newer posts
← Previous Page1 … Page3 Page4 Page5 … Page53 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress