Category "pandas"

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

How can I get branch of a networkx graph as a list from pandas dataframe in Python?

I have a pandas dataframe df which looks as follows: From To 0 Node1 Node2 1 Node1 Node3 2 Node2 Node4 3 Node2 Node5 4 Node3 Node6 5 No

Pandas wide_to_long with list of stubs

I currently have the following dataframe: 1_1 1_2 1_3 1_4 1_5 2_1 ... 9_5 10_1 10_2 10_3 10_4

pandas to_dict with python native datetime type and not timestamp

I have a pandas DataFrame df that contains Timesatamp columns. I wish to create an iterator of rows (either via the iter.. methods or via to_dict) from df whe

My text classifier model doens't improve with multiple classes

I'm trying to train a model for a text classification and the model take a list of maximum 300 integer embedded from articles. The model trains without problem