Category "pandas"

pandas copy value from one column to another if condition is met

I have a dataframe: df = col1 col2 col3 1 2 3 1 4 6 3 7 2 I want to edit df, such that when the value of col1 is smaller than

How can i find the "non-unique" rows?

I imported CSV files with over 500k rows, one year, every minute. To merge two of this files, i want so re-sample the index to every minute: Temp= pd.read_csv(

Converting object to datetime format in python

Below is the first row of my csv DateTime column: Mon Nov 02 20:37:10 GMT+00:00 2015 The DateTime column is currently an object and I want to convert it to dat

Integration of pandas timeframe

I want to integrate the following dataframe, such that I have the integrated value for every hour. I have roughly a 10s sampling rate, but if it is necissary to

Pandas to_sql to sqlite returns 'Engine' object has no attribute 'cursor'

I have a working_df in pandas I'd like to output to sqlite database. from sqlalchemy import create_engine sql_engine = create_engine('sqlite:///test.db', ech

Create dataframe column using np.where or similar when criteria matches

I'm trying to create a dataframe column using np.where or similar when certain criteria matches as follows: This linked pickle file is a segment of the data I'm

Splitting single row to multiple unique rows Pandas Permutations

I have a problem where I have to split one row into 8 combinations of rows. Example I have 8 columns -- first 6 belonging to each face of coin. and last two any

Remove repeating column values in Python Pandas

I have a data set that has dates and subtotal of other columns. I want to remove the same recurring dates per subtotal

H2O python - How to let h2oframe to dataframe with correctly character and datetime

I have a csv file, and want to use H2O to do DeepLearning. But it has some Chinese and datetime that when I finish my Deeplearning need to save output to csv, i

Why does Series.min(skipna=True) throws an error caused by na value?

I work with timestamps (having mixed DST values). Tried in Pandas 1.0.0: s = pd.Series( [pd.Timestamp('2020-02-01 11:35:44+01'), np.nan, # same result

Jupyter Notebook unable to recognize pandas library: Python

I use Windows operating system both personally in my home and at office. The Jupyter Notebook in my personal laptop is able to recognize pandas library. I can

How to Remove outlier from DataFrame using IQR?

I Have Dataframe with a lot of columns (Around 100 feature), I want to apply the interquartile method and wanted to remove the outlier from the data frame. I a

How can i fill in missing csv file value base on reference csv file

I have a reference file like this Id, Value1, Value2 a, a1, a2 b, b1, b2 c, c1, c2 d, d1, d2 ... n, n1, n2 and the missing file Id, Value1, Value2 d, ,

Sort_values Pandas to sort by index?

I know that sort_index() lets me sort a df by the index, but I am wondering if sort_values() can sort by the index too (without resetting the index)?

How to replace the missing values with average of ffill() and bfill() in pandas?

This is a sample dataframe and it containsNA: x y z datetime 0 2 3 4 02-02-2019 1 NA NA NA 03-02-2019 2 3 5 7 04-0

Fill empty cells in column with value of other columns

I have a HC list in which every entry should have an ID, but some entries do not have an ID. I would like to fill those empty cells by combining the the first n

Scatter plot form dataframe with index on x-axis

I've got pandas DataFrame, df, with index named date and the columns columnA, columnB and columnC I am trying to scatter plot index on a x-axis and columnA on

Pandas - image to DataFrame

I want to convert an RGB image into a DataFrame, so that I have the co-ordinates of each pixel and their RGB value. x y red green blue 0

Pandas - image to DataFrame

I want to convert an RGB image into a DataFrame, so that I have the co-ordinates of each pixel and their RGB value. x y red green blue 0

Read JSON to pandas dataframe - ValueError: Mixing dicts with non-Series may lead to ambiguous ordering

I am trying to read in the JSON structure below into pandas dataframe, but it throws out the error message: ValueError: Mixing dicts with non-Series may le