Category "pandas"

Choose the rows with special conditions in dataframe

I have a dataframe, I want to choose the rows which their average value for column val1 until val4 is greater than 1 and the number of zeros for the row is not

Pandera: Is cell based dataframe data validation possible?

Every row of my dataframe contain a record with a unique key combination. The data validation will be based on the columns and on key combination. For example,

How to fill in the blanks for one (or more) columns by calculating based on multiple conditions?

I collect and process hundreds of jumbled tables every day, and some of the data requires attention. (Sorry for my English and typography skills) The item with

How to create a new index level with columns name in Pandas?

I would like to add a new level to the index of a dataframe, based on columns name. How can i do that ? df home city A -0.166809 0.213299 B -0.

Saving data in the table

How I can save this: a=1b=2c=3d=4 into the table like this (I do not need header): 1 2 3 4 Thanks.

How do I turn dataframe#1 into something i can properly graph, like dataframe#2? [duplicate]

I have the following dataframe, based on data i pulled from my database: date event_type count 2022-05-10 page_view 3 2022-05-11 cart_add 2 2

Exception has occurred: ModuleNotFoundError No module named 'tensorflow.python'

im working on Simple RNN code with python, i want to use keras but when i run the code it show to me ( tensorflow error ), i uninstall tensorflow then i install

calculationg the mean from each Dataframe column

I've to write a function (column_means), that calculates the mean of each column from Dataframe and give me a list of means at the end. I'm not allowed to use t

Dataframe extracted from email, ValueError: Cannot index with multidimensional key

A dataframe extracted from email (email saved to local disk, ".msg"), that I am not able to read its content. The dataframe extracted from email, when wrote to

Data problem: identifying data rows where colleagues have reached a consensus

I have a table that shows the results of four colleagues trying to classify several objects as either a, b, c or d. If the colleagues were able to agree on the

Chaining Pandas DataFrame Styles

*edited DataFrame random generator I have 2 dfs, one used as a mask for the other. rndm = pd.DataFrame(np.random.randint(0,15,size=(100, 4)), columns=list('ABCD

how to apply a format on multiple excel files at once (hide gridlines & autofit columns)

I'm trying to apply a specific format on an iterate excel files, i need to hide the gridlines and autofit columns width, i tried many codes and styles but no on

Analysing words in dataset based on training data

I have a training dataset for eg. Letter Word A Apple B Bat C Cat D Dog E Elephant and I need to check the dataframe

What would be the correct merge function in this pandas dataframe?

df.head() index match_datetime country league home_team away_team home_odds draw_odds away_odds predicted_home_sco

Read images from url and put them on a dataframe column with the label to another column in python

I would like to read images from url and place them on a pandas dataframe column and place label to another another column. How can I do that please help. Below

Why is lambda not working property 'value'?

this df2['CLINE_TYPE']: Increase_FALSE Decrease Increase_FALSE Increase_SUPERPOSITION Decrease_FALSE Increase Increase_SUPERPOSITION Decrease_FALSE Increase Inc

What would be the equivalent code of following google finance query in python?

I'm trying to fetch weekly EOD data in python using yfinance module. I wanna use the same format of the excel code given below. gives me weekly closes (Friday)

First occurrence of a specific value in a row (prepping for survival analysis) - python

I have the following data (see attached - easier this way). I am trying to find the first occurrence of the value 0 for each customer ID. Then, I plan to use c

Find nth occurrence of a character in a row and replace it in Python, in order to fix/replace a wrong/leftover ";" separator in a text file

I would like to import a text file, with 14 columns with the symbol ";" as a column separator. So, if we have 14 columns, it means we'll find 13 ";" separators

How to count values between a date time and make a new column out of it

In Python Pandas I need to create a new column in a dataframe (number of encounters in last year) in the below dataframe with the following logic. I want to cou