Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
69 views

pandas get min and max value for multiple rows

i have these cols "Price", "functions", & "cat" as df. Price functions cat 51272.85 8 3-8 51134.15 3 3-8 51150 8 3-8 51161.3 1 1-6 51165.45 1 ...
rakesh's user avatar
  • 99
1 vote
1 answer
41 views

How to create DataFrame that is the minimal values based on 2 other DataFrame's in pandas (python)?

Let's say I have DataFrames df1 and df2: >>> df1 = pd.DataFrame({'A': [0, 2, 4], 'B': [2, 17, 7], 'C': [4, 9, 11]}) >>> df1 A B C 0 0 2 4 1 2 17 9 2 4 7 11 >&...
k1r1t0's user avatar
  • 787
0 votes
0 answers
30 views

Slope of a timeseries dataset based on Max/Min Value to the start of the slope in a for loop

Newbie to python. I have a time series dataset that always has time in the first column, and multiple columns of data (This can be from 3 columns plus time upto 100 columns with 500k rows). This will ...
Fergs's user avatar
  • 9
0 votes
2 answers
44 views

Pandas get Min & max of varying range

I have following table in as df. Price Stop Max Min 15 15 5 35 85 67 67 75 54 17 75 75 52 ...
rakesh's user avatar
  • 99
1 vote
2 answers
62 views

How to find the smallest maximum of a column with pandas after filtering?

I have a dataframe: import pandas as pd df = pd.DataFrame( {'team': ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'], 'variable': [8, 9, 10, 11, 2, 3, 4, 5], 'another_variable': [1, 1, 1, 2, 1, ...
Maxim Moloshenko's user avatar
0 votes
2 answers
686 views

Python pandas Get daily: MIN MAX AVG results of datasets

Using Python with pandas to export data from a database to csv.Data looks like this when exported. Got like 100 logs/day so this is pure for visualising purpose: time Buf1 Buf2 12/12/2022 19:15:56 12 ...
UwUs's user avatar
  • 157
0 votes
1 answer
42 views

Pandas .min() not getting lowest value per week

I have a dateframe with, for every hour for each day, the amount of gas and electricity used: elec gas day_of_week DuringBusinessHours ts 2022-04-30 01:00:...
Julius's user avatar
  • 49
1 vote
1 answer
423 views

How to create a column based on the min date of multiple columns?

print (df) Event1 Event2 Event3 0 7/27/2014 NaN NaN 1 3/5/2016 NaN 2/1/2013 2 5/13/2017 5/10/2013 NaN 3 NaN NaN 4/28/2014 4 NaN ...
weizer's user avatar
  • 1,127
0 votes
2 answers
41 views

Python: Fetch value from dataframe list with min value from another column list of same dataframe

input dataframe Flow row count Apple [45,46] [2,1] Orange [13,14] [1,5] need to find min value of each list column 'count' and fetch respective row value from row column. ...
user12345's user avatar
  • 509
1 vote
1 answer
72 views

Get max/min value of batches of rows, where condition exists

I need your help/guidance with this particular problem. I am dealing with a dataframe like this: datetime high low 1 2022-08-26 19:00:00+00:00 NaN 0.99564 6 ...
som3k's user avatar
  • 57
0 votes
1 answer
95 views

min function on pyspark pandas is too slow

I have a scenario where I am reading 200 million records from Azure blob into pyspark pandas dataframe, executing multiple column operations (data type change, renaming of columns, calculations with ...
Sumithra S's user avatar
1 vote
1 answer
89 views

Dataframe: How to get the minimum number between 2 identical numbers in the same column?

Definitely easier to show via an example: {'Close': {Timestamp('1980-12-12 00:00:00'): 28.75, Timestamp('1980-12-15 00:00:00'): 27.25, Timestamp('1980-12-16 00:00:00'): 25.25, Timestamp('1980-12-17 00:...
Katsu's user avatar
  • 8,955
1 vote
1 answer
48 views

Python: Extract column name for earliest and latest columns

I have a dataset with multiple date columns as follows Input Dataframe > df Date1 Date2 Date3 2008-08-11 NaT 2005-05-14 2010-06-18 2012-09-04 2003-01-16 NaT 2006-11-...
NAS_2339's user avatar
  • 363
0 votes
1 answer
487 views

Pandas - Min and Max function

I am playing with the min and max functions in python I'm wondering if there's a way to get a unique list of items and then print the min and max values of each column example: Month T-shirt Sales Hat ...
PythonBeginner's user avatar
0 votes
2 answers
1k views

Find min and max of non-zero values in a column

I try to get the min and max value (as a float) of a column without the zero values. I tried: minValue = df[df['col1']>0.1].min() maxValue = df['col2'].max() type minValue --> pandas.core....
Marvy's user avatar
  • 87

15 30 50 per page
1
2 3 4 5
8