Tag Archives: pandas

corrplot function in Python

Tweet We’ve implemented a corrplot function in Python, which is available in BioKit package – github https://github.com/biokit/biokit – pypi https://pypi.python.org/pypi/biokit For illustration, let us create some random data sets:

The correlation matrix is stored in the Pandas dataframe called … Continue reading

Posted in Python | Tagged , , , | 2 Comments

Pandas : how to compare dataframe with None

Tweet While comparing a pandas dataframe with None,

I got this error:

I could go around the problen using the isinstance command:

In fact, the first code could be changed just slightly by replacing the comparison operator … Continue reading

Posted in Python | Tagged | Leave a comment

pandas.read_csv: how to skip empty lines

Tweet Let us suppose that we start with a CSV file that has empty rows:

If you read this file with Pandas library, and look at the content of your dataframe, you have 2 rows including the empty one … Continue reading

Posted in Python | Tagged | 2 Comments

Pandas dataframe: grouping column by name

Tweet Let us consider this data set in CSV format:

The problem is to read the data and average the columns that have the same name. You can read the CSV file with pandas.read_csv function or build the data … Continue reading

Posted in Python | Tagged | 5 Comments

Starting to use Python Pandas library

Tweet Pandas is brilliant. If you are looking to manipulate data in Python, use it. I am refactoring most of my codes with this library. It provides many useful data structures to manipulate data in 2, 3, 4 dimensions and … Continue reading

Posted in Python | Tagged , | Leave a comment

pandas import fails with ImportError: cannot import name hashtable

Tweet Import of pandas raises the following error:

Starting a python session, I typed

and got this new message:

The issue was thast the wrong version of numpy was picked up: I ws in a virtual environement … Continue reading

Posted in Python | Tagged | Leave a comment