in Education by
I would Like to get a count of the number of days for which (VZ) stock return is larger than the stock index return (INX) I already calculated the return using the pct_change function. Now I want to get the number of days VZ is larger than INX. I don't know how to go about this. Dates VZ INX 2016-03-21 NaN NaN 2016-03-22 -0.004304 -0.000877 2016-03-23 -0.005638 -0.006386 2016-03-24 0.012285 -0.000378 2016-03-28 -0.002987 0.000545 2016-03-29 0.012172 0.008817 2016-03-30 -0.000185 0.004350 2016-03-31 0.000740 -0.002040 2016-04-01 -0.001294 0.00633 1 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
To do this you can check which times the "VZ" value is higher than the "INX" value using a column operation, and get the sum of the output: temp = df["VZ"] > df["INX"] print(temp.sum())

Related questions

0 votes
    I would Like to get a count of the number of days for which (VZ) stock return is larger than the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    _________ involves predicting a response with meaningful magnitude, such as quantity sold, stock price, or return on ... R Programming Select the correct answer from above options...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    I am a number I am not an odd number I am higher than 90 I am not higher than 100 If you subtract me from 100, you get nothing. What number am I?...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
    Why are reactions of higher order less in number? Select the correct answer from above options...
asked Jan 4, 2022 in Education by JackTerrance
0 votes
    If page size of 1MB memory is 1 KB then the number of higher order bits of address bus used to denote page number is ( ... (c) 12 (d) 9 Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    A and B throw a pair of dice. If A throws 9, find B’s chance of throwing a higher number. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    How can we get count of the number of records in a table?...
asked Nov 9, 2020 in Technology by Editorial Staff
0 votes
    Which of the following count the number of good cases when doing pairwise analysis? (a) count.pairwise (b) ... of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    What's the simplest way to count the number of occurrences of a character in a string? e.g. count the number of ... had a little lamb' Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    5. Write a program to count the number of spaces, upper case and lower case characters in a string, where the ... entered by the user Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    Write pseudo code to count occurrence of a given number in the list. For example, consider the following list, if ... in the list. Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    C program to count number of words in a sentence including comma tabs Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    What is the procedure to count the number of times a given value appears in an array of integers?...
asked Apr 24, 2021 in Technology by JackTerrance
0 votes
    Find a 10-digit number, where the first figure defines the count of zeros in this number, the second figure the ... character expresses the count of the numeral 9 in this number....
asked Feb 13, 2021 in Education by JackTerrance
...