Replace column values according to corresponding values of other column in Pandas
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to replace value of columns on basis of column. for example col1 has values in first 5 rows and col2 has values so update col1 values according to col2.
For next five rows there are no value in col1 but col2 have value just skip these rows dont need to update col1, and so on.
df9["col1"].replace(["s1"], "data_value", inplace=True)
i used this code line from Replacing few values in a pandas dataframe column with another value. It gives me output just replace value with data value , not replace with values inside data value column.
Dataframe
col1 col2 col3 col4
0 s1 NaN NaN NaN
1 s1 NaN NaN NaN
2 s1 NaN NaN NaN
3 s1 NaN NaN NaN
4 s1 NaN NaN NaN
5 NaN s2 NaN NaN
6 NaN s2 NaN NaN
7 NaN s2 NaN NaN
8 NaN s2 NaN NaN
9 NaN s2 NaN NaN
10 NaN NaN ss1 NaN
11 NaN NaN ss1 NaN
12 NaN NaN ss1 NaN
13 NaN NaN ss1 NaN
14 NaN NaN ss1 NaN
15 NaN NaN NaN ss333
16 NaN NaN NaN ss333
17 NaN NaN NaN ss333
18 NaN NaN NaN ss333
19 NaN NaN NaN ss333
Desired output:
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
python-3.x pandas dataframe pandas-groupby
add a comment |
I am trying to replace value of columns on basis of column. for example col1 has values in first 5 rows and col2 has values so update col1 values according to col2.
For next five rows there are no value in col1 but col2 have value just skip these rows dont need to update col1, and so on.
df9["col1"].replace(["s1"], "data_value", inplace=True)
i used this code line from Replacing few values in a pandas dataframe column with another value. It gives me output just replace value with data value , not replace with values inside data value column.
Dataframe
col1 col2 col3 col4
0 s1 NaN NaN NaN
1 s1 NaN NaN NaN
2 s1 NaN NaN NaN
3 s1 NaN NaN NaN
4 s1 NaN NaN NaN
5 NaN s2 NaN NaN
6 NaN s2 NaN NaN
7 NaN s2 NaN NaN
8 NaN s2 NaN NaN
9 NaN s2 NaN NaN
10 NaN NaN ss1 NaN
11 NaN NaN ss1 NaN
12 NaN NaN ss1 NaN
13 NaN NaN ss1 NaN
14 NaN NaN ss1 NaN
15 NaN NaN NaN ss333
16 NaN NaN NaN ss333
17 NaN NaN NaN ss333
18 NaN NaN NaN ss333
19 NaN NaN NaN ss333
Desired output:
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
python-3.x pandas dataframe pandas-groupby
Please add your dataframe to the question and not as an image or a link.
– Mohit Motwani
Jan 4 at 6:23
add a comment |
I am trying to replace value of columns on basis of column. for example col1 has values in first 5 rows and col2 has values so update col1 values according to col2.
For next five rows there are no value in col1 but col2 have value just skip these rows dont need to update col1, and so on.
df9["col1"].replace(["s1"], "data_value", inplace=True)
i used this code line from Replacing few values in a pandas dataframe column with another value. It gives me output just replace value with data value , not replace with values inside data value column.
Dataframe
col1 col2 col3 col4
0 s1 NaN NaN NaN
1 s1 NaN NaN NaN
2 s1 NaN NaN NaN
3 s1 NaN NaN NaN
4 s1 NaN NaN NaN
5 NaN s2 NaN NaN
6 NaN s2 NaN NaN
7 NaN s2 NaN NaN
8 NaN s2 NaN NaN
9 NaN s2 NaN NaN
10 NaN NaN ss1 NaN
11 NaN NaN ss1 NaN
12 NaN NaN ss1 NaN
13 NaN NaN ss1 NaN
14 NaN NaN ss1 NaN
15 NaN NaN NaN ss333
16 NaN NaN NaN ss333
17 NaN NaN NaN ss333
18 NaN NaN NaN ss333
19 NaN NaN NaN ss333
Desired output:
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
python-3.x pandas dataframe pandas-groupby
I am trying to replace value of columns on basis of column. for example col1 has values in first 5 rows and col2 has values so update col1 values according to col2.
For next five rows there are no value in col1 but col2 have value just skip these rows dont need to update col1, and so on.
df9["col1"].replace(["s1"], "data_value", inplace=True)
i used this code line from Replacing few values in a pandas dataframe column with another value. It gives me output just replace value with data value , not replace with values inside data value column.
Dataframe
col1 col2 col3 col4
0 s1 NaN NaN NaN
1 s1 NaN NaN NaN
2 s1 NaN NaN NaN
3 s1 NaN NaN NaN
4 s1 NaN NaN NaN
5 NaN s2 NaN NaN
6 NaN s2 NaN NaN
7 NaN s2 NaN NaN
8 NaN s2 NaN NaN
9 NaN s2 NaN NaN
10 NaN NaN ss1 NaN
11 NaN NaN ss1 NaN
12 NaN NaN ss1 NaN
13 NaN NaN ss1 NaN
14 NaN NaN ss1 NaN
15 NaN NaN NaN ss333
16 NaN NaN NaN ss333
17 NaN NaN NaN ss333
18 NaN NaN NaN ss333
19 NaN NaN NaN ss333
Desired output:
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
python-3.x pandas dataframe pandas-groupby
python-3.x pandas dataframe pandas-groupby
edited Jan 4 at 12:52
Mohit Motwani
2,3991725
2,3991725
asked Jan 4 at 6:19
NickelNickel
1097
1097
Please add your dataframe to the question and not as an image or a link.
– Mohit Motwani
Jan 4 at 6:23
add a comment |
Please add your dataframe to the question and not as an image or a link.
– Mohit Motwani
Jan 4 at 6:23
Please add your dataframe to the question and not as an image or a link.
– Mohit Motwani
Jan 4 at 6:23
Please add your dataframe to the question and not as an image or a link.
– Mohit Motwani
Jan 4 at 6:23
add a comment |
2 Answers
2
active
oldest
votes
Use mask for replace all not missing values with pop for extract column Data:
df = pd.DataFrame({
'A':[4,5] + [np.nan] * 4,
'B':[np.nan,np.nan,9,4,np.nan,np.nan],
'C':[np.nan] * 4 + [7,0],
'Data':list('aaabbb')
})
print (df)
A B C Data
0 4.0 NaN NaN a
1 5.0 NaN NaN a
2 NaN 9.0 NaN a
3 NaN 4.0 NaN b
4 NaN NaN 7.0 b
5 NaN NaN 0.0 b
df = df.mask(df.notnull(), df.pop('Data'), axis=0)
print (df)
A B C
0 a NaN NaN
1 a NaN NaN
2 NaN a NaN
3 NaN b NaN
4 NaN NaN b
5 NaN NaN b
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
1
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
1
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
add a comment |
Alternatively you can also use where
df = pd.DataFrame({'col1': ['s1']*5+[np.nan]*15,
'col2':[np.nan]*5+['s2']*5+[np.nan]*10,
'col3':[np.nan]*10+['ss1']*5+[np.nan]*5,
'col4':[np.nan]*15+['ss333']*5,
'data_value':[0]*10+[500]*10 })
df = df.where(df.isnull(), df.pop('data_value'), axis = 0)
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54033923%2freplace-column-values-according-to-corresponding-values-of-other-column-in-panda%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Use mask for replace all not missing values with pop for extract column Data:
df = pd.DataFrame({
'A':[4,5] + [np.nan] * 4,
'B':[np.nan,np.nan,9,4,np.nan,np.nan],
'C':[np.nan] * 4 + [7,0],
'Data':list('aaabbb')
})
print (df)
A B C Data
0 4.0 NaN NaN a
1 5.0 NaN NaN a
2 NaN 9.0 NaN a
3 NaN 4.0 NaN b
4 NaN NaN 7.0 b
5 NaN NaN 0.0 b
df = df.mask(df.notnull(), df.pop('Data'), axis=0)
print (df)
A B C
0 a NaN NaN
1 a NaN NaN
2 NaN a NaN
3 NaN b NaN
4 NaN NaN b
5 NaN NaN b
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
1
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
1
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
add a comment |
Use mask for replace all not missing values with pop for extract column Data:
df = pd.DataFrame({
'A':[4,5] + [np.nan] * 4,
'B':[np.nan,np.nan,9,4,np.nan,np.nan],
'C':[np.nan] * 4 + [7,0],
'Data':list('aaabbb')
})
print (df)
A B C Data
0 4.0 NaN NaN a
1 5.0 NaN NaN a
2 NaN 9.0 NaN a
3 NaN 4.0 NaN b
4 NaN NaN 7.0 b
5 NaN NaN 0.0 b
df = df.mask(df.notnull(), df.pop('Data'), axis=0)
print (df)
A B C
0 a NaN NaN
1 a NaN NaN
2 NaN a NaN
3 NaN b NaN
4 NaN NaN b
5 NaN NaN b
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
1
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
1
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
add a comment |
Use mask for replace all not missing values with pop for extract column Data:
df = pd.DataFrame({
'A':[4,5] + [np.nan] * 4,
'B':[np.nan,np.nan,9,4,np.nan,np.nan],
'C':[np.nan] * 4 + [7,0],
'Data':list('aaabbb')
})
print (df)
A B C Data
0 4.0 NaN NaN a
1 5.0 NaN NaN a
2 NaN 9.0 NaN a
3 NaN 4.0 NaN b
4 NaN NaN 7.0 b
5 NaN NaN 0.0 b
df = df.mask(df.notnull(), df.pop('Data'), axis=0)
print (df)
A B C
0 a NaN NaN
1 a NaN NaN
2 NaN a NaN
3 NaN b NaN
4 NaN NaN b
5 NaN NaN b
Use mask for replace all not missing values with pop for extract column Data:
df = pd.DataFrame({
'A':[4,5] + [np.nan] * 4,
'B':[np.nan,np.nan,9,4,np.nan,np.nan],
'C':[np.nan] * 4 + [7,0],
'Data':list('aaabbb')
})
print (df)
A B C Data
0 4.0 NaN NaN a
1 5.0 NaN NaN a
2 NaN 9.0 NaN a
3 NaN 4.0 NaN b
4 NaN NaN 7.0 b
5 NaN NaN 0.0 b
df = df.mask(df.notnull(), df.pop('Data'), axis=0)
print (df)
A B C
0 a NaN NaN
1 a NaN NaN
2 NaN a NaN
3 NaN b NaN
4 NaN NaN b
5 NaN NaN b
answered Jan 4 at 6:30
jezraeljezrael
358k26323402
358k26323402
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
1
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
1
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
add a comment |
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
1
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
1
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
@MohitMotwani - Sure, it is only inverted my solution.
– jezrael
Jan 4 at 7:45
1
1
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
Okay thank you :}
– Mohit Motwani
Jan 4 at 7:46
1
1
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
@jezrael @ Mohit Motwani thanks my this method worked for my problem
– Nickel
Jan 4 at 15:21
add a comment |
Alternatively you can also use where
df = pd.DataFrame({'col1': ['s1']*5+[np.nan]*15,
'col2':[np.nan]*5+['s2']*5+[np.nan]*10,
'col3':[np.nan]*10+['ss1']*5+[np.nan]*5,
'col4':[np.nan]*15+['ss333']*5,
'data_value':[0]*10+[500]*10 })
df = df.where(df.isnull(), df.pop('data_value'), axis = 0)
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
add a comment |
Alternatively you can also use where
df = pd.DataFrame({'col1': ['s1']*5+[np.nan]*15,
'col2':[np.nan]*5+['s2']*5+[np.nan]*10,
'col3':[np.nan]*10+['ss1']*5+[np.nan]*5,
'col4':[np.nan]*15+['ss333']*5,
'data_value':[0]*10+[500]*10 })
df = df.where(df.isnull(), df.pop('data_value'), axis = 0)
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
add a comment |
Alternatively you can also use where
df = pd.DataFrame({'col1': ['s1']*5+[np.nan]*15,
'col2':[np.nan]*5+['s2']*5+[np.nan]*10,
'col3':[np.nan]*10+['ss1']*5+[np.nan]*5,
'col4':[np.nan]*15+['ss333']*5,
'data_value':[0]*10+[500]*10 })
df = df.where(df.isnull(), df.pop('data_value'), axis = 0)
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
Alternatively you can also use where
df = pd.DataFrame({'col1': ['s1']*5+[np.nan]*15,
'col2':[np.nan]*5+['s2']*5+[np.nan]*10,
'col3':[np.nan]*10+['ss1']*5+[np.nan]*5,
'col4':[np.nan]*15+['ss333']*5,
'data_value':[0]*10+[500]*10 })
df = df.where(df.isnull(), df.pop('data_value'), axis = 0)
col1 col2 col3 col4
0 0 NaN NaN NaN
1 0 NaN NaN NaN
2 0 NaN NaN NaN
3 0 NaN NaN NaN
4 0 NaN NaN NaN
5 NaN 0 NaN NaN
6 NaN 0 NaN NaN
7 NaN 0 NaN NaN
8 NaN 0 NaN NaN
9 NaN 0 NaN NaN
10 NaN NaN 500 NaN
11 NaN NaN 500 NaN
12 NaN NaN 500 NaN
13 NaN NaN 500 NaN
14 NaN NaN 500 NaN
15 NaN NaN NaN 500
16 NaN NaN NaN 500
17 NaN NaN NaN 500
18 NaN NaN NaN 500
19 NaN NaN NaN 500
answered Jan 4 at 7:42
Mohit MotwaniMohit Motwani
2,3991725
2,3991725
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54033923%2freplace-column-values-according-to-corresponding-values-of-other-column-in-panda%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Please add your dataframe to the question and not as an image or a link.
– Mohit Motwani
Jan 4 at 6:23