rer49

1

votes
1

answer
0

views

How to Change Color of Line graphs in Statsmodel Decomposition Plots

The default color of the seasonal decomposition graphs is a light blue. 1. How can you change the colors so that each of the lines is a different color? 2. If each plot can not have a separate color, how would I change all of the colors to say red? I've tried adding arguments to decomposition.plot(c...
rer49
1

votes
2

answer
50

views

Calculate difference between one observation and all other observations by group

I am trying to create the Distance between the first observation and all other observations within a group. The first observation within group A is a1 and group B is b1. I want a new column in df,'Euclidean', that would have the distance of each observation from the first observation calculated by g...
rer49
0

votes
0

answer
13

views

How to dynamically indicate the start as well as the end of a set of conditions within a DataFrame?

I I seek to create an indicator column in a dataframe that looks at the values of entry and exit column and creates a window that has the following logic: Find earliest date where entry is a 1 (1/3/2019) and mark window as 1. Window remains 1 until exit is 1 (1/5/2019). Window then becomes 0 until i...
rer49
3

votes
3

answer
79

views

Checking multiple columns condition in pandas

I want to create a new column in my dataframe that places the name of the column in the row if only that column has a value of 8 in the respective row, otherwise the new column's value for the row would be 'NONE'. For the dataframe df, the new column df['New_Column'] = ['NONE','NONE','A','NONE'] df...
rer49
2

votes
1

answer
29

views

Comparing column values within a row within a Pandas Dataframe

I have a specific and a general problem I'm trying to solve. Specific Problem: I want to create a new column in a data frame that gives a 1 if column C1 is 8 and all other values in the row are less than 8.How do I logically negate all of the other columns at the same time? Here is the code from my...
rer49