Category "pandas"

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

Percent change using Pandera for Pandas DataFrame

I have the following DataFrame. I need to do validation of balance and other numeric measures over date range. I want to check if for any group and date, the ba

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

Network Flow Dataframe - Merging Memory Error - Unable to allocate array with shape and data type

I have big 3 CSV files and they are all 76 same columns. The number of rows are different 17809 rows - 124262 rows - 108779 rows I am trying to merge these 3 d

Accumulate 1 and Reset to 0 once condition is met

Currently I have a dataset below and I try to accumulate the value if ColA is 0 while reset the value to 0 (restart counting again) if the ColA is 1 again. Col

pandas non equi join in range

I need to do 'pandas non equi join', when first table joined with second table in range. first_table EMPLOYEE_ID SALARY 100 3000.00 101 17000.00 102

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

Can't take value from series in python

I'm trying to get value from the pandas series. Like in the arrays I'm trying to get 3. value with tempArray[3] but the code gives me where the value inside the

Conditional formatting on Duplicates using pandas

I have a dataFrame with 6 columns. And I want to do conditional formatting on two columns of them. So my dataFrame looks like this And I want to highlight du

Pandas pivot_table is giving the error ValueError: The name None occurs multiple times, use a level number

I have a pandas dataframe print(df.head()) Row ID Order ID Order Date ... Quantity Discount Profit 0 1 CA-2013-152156 09/11/2013 ..

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

In Pandas sum columns and change values to proportion of sum

If I have the following DataFrame, how can I convert the value in each row to the proportion of the total of the columns? Input: pd.DataFrame( {'A': {0: 1, 1: 1

SQL query returns result multiple times

I'm pretty new to SQL and am trying to join some tables in SQL. I'm using SQLite3 and Pandas and have the following table structure: User | Measuremen

SQL query returns result multiple times

I'm pretty new to SQL and am trying to join some tables in SQL. I'm using SQLite3 and Pandas and have the following table structure: User | Measuremen

FileNotFoundError when reading .h5 file from S3 in python using Pandas

For some reason, when I attempt to read a hdf file from S3 using the pandas.read_hdf() method, I get a FileNotFoundError when I put an s3 url. The file definite

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

FInding fft gives keyerror :'Aligned ' pandas

I have a time series data I am trying to find the fft .But it gives keyerror :Aligned when trying to get the value my data looks like below this is the code: i

FInding fft gives keyerror :'Aligned ' pandas

I have a time series data I am trying to find the fft .But it gives keyerror :Aligned when trying to get the value my data looks like below this is the code: i

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