Skip to content

Tag: pandas

How to filter columns containing missing values

I am using the following code: to create a heatmap of missing values of the df. However since my df has a lot of columns, the chart has to be very tall in order to accommodate all the information. I tried altering the data argument to be something like this: data = df[df.columns.values.isna()].isna() or data …

Use list items as column seperators pd.read_fwf

I have text files containing tables which I want to put into a dataframe. Per file the column headers are the same, but the width is different depending on the content (because they contain names of different lengths for example). So far I managed to get the index of the first character of the header, so I kn…

Python- trying to make new list combining values from other list

I’m trying to use two columns from an existing dataframe to generate a list of new strings with those values. I found a lot of examples doing something similar, but not the same thing, so I appreciate advice or links elsewhere if this is a repeat question. Thanks in advance! If I start with a data frame…