Category "dataframe"

How to select top level columns in multi header pandas dataframe

I have a multi header dataframe and it looks like that: SPY ARKW Open Hig

Is there a way to dynamically create new arrays from a dataframe

I have a table that looks like |Category|number|absorbance|protein1|protein2| |--------|------|----------|--------|--------| |a|int|float|float|float| |a|int|fl

Load Pandas Dataframe to S3 passing s3_additional_kwargs

Please excuse my ignorance / lack of knowledge in this area! I'm looking to upload a dataframe to S3, but I need to pass 'ACL':'bucket-owner-full-control'. i

How do I melt a pandas with custom nam

I have a table like this device_type version pool testMean testP50 testP90 testP99 testStd WidgetMean WidgetP50 WidgetP90 WidgetP99 WidgetStd PNB0Q

How do I melt a pandas with custom nam

I have a table like this device_type version pool testMean testP50 testP90 testP99 testStd WidgetMean WidgetP50 WidgetP90 WidgetP99 WidgetStd PNB0Q

Python Script to find file names from CSV will not concatenate

I am writing a script that will allow me to extract a segment of image files from a large folder. I put the image file names into a dataframe. I am having prob

Creating New columns from other pandas column

I would like to create a new Column from the genres column. The genres column contains one or multiple genres and I would like to create a column for each genre

Sort dataframe multiindex level and by column

#Updated: pandas version 0.23.0 solves this problem with Sorting by a combination of columns and index levels I have struggled with this and I suspect there is

Find specific value knowing row pandas

I have a dataframe with this structure: A indexer attr1_rank attr2_rank attr3_rank attr4_rank ... attrn_rank P 1 2 1 3 4 ... n S 2 1 2 4 3 ... n How can i add

how to merge multiple datasets with differences in merge-index strings?

Hello I am struggling to find a solution to probably a very common problem. I want to merge two csv-files with soccer data. They basically store different data

How to solve (NaN error) when given column specific name

I have many text files include data as follow: 350.0 2.1021 0.0000 1.4769 0.0000 357.0 2.0970 0.0000 1.4758 0.0000 364.0 2.0920 0.0000

How to solve (NaN error) when given column specific name

I have many text files include data as follow: 350.0 2.1021 0.0000 1.4769 0.0000 357.0 2.0970 0.0000 1.4758 0.0000 364.0 2.0920 0.0000

Replace values conditionally, better way

I have a large dataframe with city names and many are misspelled. Right now I have corrected then manually, one by one, using the following code: geo <- geo

Add 'total' row for each group in a column in df

I have a dataframe where the column size can be grouped. When the dataframe is arranged by size, I would like to show the totals of each column for each group a

Pandas- DataError: No numeric types to aggregate

I have a DataFrame with 5 columns, where the column i need to aggregate is of a string, and has NaN values. I tried replacing the nan values with 0 and then con

Combinations divided into rows with no repetition of elements

I'm working with lists in Python. I have a list of colleagues which is colleagues=['Jack', 'Jessica' 'John', 'Mark', 'Mary', 'Paul'] I want to calculate all po

Rearrange pandas Dataframes

I decide to simplify my post and replace images with code which has the same structure (and problem) inside and everyone could 'copy-paste' this example to try

How to replace column values with dictionary keys

I have a df, A B one six two seven three level five one and a dictionary my_dict={1:"one,two",2:"three,four"} I want to replace df.A with my_di

df.to_csv function prints out the content instead of writing data to a file

df.to_csv(output_file) is supposed to write the content of a DataFrame to a file. While the function is working for 99.9% of the file in my directory, there is

Python Pandas - Find difference between two data frames

I have two data frames df1 and df2, where df2 is a subset of df1. How do I get a new data frame (df3) which is the difference between the two data frames? In o