in Education by
I have the data frame that looks like this: Date Visa Mastercard Amex Paypal 1/1/20 0 20 0 0 2/1/20 15 0 0 0 3/1/20 30 0 0 0 4/1/20 0 15 0 0 5/1/20 0 0 50 0 I will like to count the number of times Visa, MasterCard, AMEX, and PayPal appeared, which is 2 times for visa and Mastercard, 1x for AMEX, and 0 for Paypal. And then I will like to plot it. Is there any way to go about dealing with this? I do have the rough idea based on using df.info() Any help is appreciated Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
import matplotlib.pyplot as plt visa = df['Visa'].value_counts() mc = df['Mastercard'].value_counts() amex= df['Amex'].value_counts() pp = df['Paypal'].value_counts() plt.plot([visa,mc,amex,pp]) plt.show() This takes a value counts and plots them all against each other. If you are a beginner and want to know more about Python the do check out the Python for data science

Related questions

0 votes
    I want to calculate a percentage, for each id, of True values from all rows of the id. Here an example ... df.num_true/df.num_col1_id Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    I have data like this: id a b c d 1 y y z z 2 y z y y 3 y y y y I want to count the value of "y" ... 1 2 2 1 3 4 Can anyone help me? Select the correct answer from above options...
asked Jan 9, 2022 in Education by JackTerrance
0 votes
    I have the dataset that has the no_employees column that is the str object. whats is a best way to create the new ... 1-5 |Very Small Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    please see my code below, example_list = [ ['a','b','c'], ['f','g','h'], ['i','j','k'], ] my_string = ''' ' ... g','h'), ('i','j','k'); Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    A few days ago I've started learning pygame. So, now I've got the code which allows me to draw different ... ) py.display.update() Select the correct answer from above options...
asked Jan 11, 2022 in Education by JackTerrance
0 votes
    I have this following datetime64[ns] type timestamps. x1=pd.Timestamp('2018-04-25 00:00:00') x2=pd.Timestamp('2020- ... -04-25 00:53:00 Select the correct answer from above options...
asked Jan 9, 2022 in Education by JackTerrance
0 votes
    I have a big data frame. I want to replace float 1.0 and 0.0 with the true and false. My code: import pandas ... to do it in one line. Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    I am totally new to Machine Learning and I have been working with unsupervised learning technique. Image shows my ... 3 were given Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I want to upload the file pdf to the folder but a file is not saved to a folder. I already read the ... .run(debug=True)``` Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    When I run pip3 install -r requirements.txt on the project I get this error message: pip._vendor.pkg_resources. ... on my machine. Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    To the data frame df: Player Team Points Mean Price Value Gameweek 1 Jim Leeds 4.4 4.40 10.44 0.44 2 Jim ... scalar What am I missing? Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
0 votes
    SA=1000.00 AI=0.12 MP=100.00 def remainb(x): if x==0: return 0 else: return x=(SA+(AI/12)*SA)-MP for ... . run the loop until SA==0). Select the correct answer from above options...
asked Jan 11, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me what is Python with Data Science? Select the correct answer from above options...
asked Jan 11, 2022 in Education by JackTerrance
0 votes
    I am training on 970 samples and validating on 243 samples. How big should batch size and number of epochs be ... on data input size? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    Suppose I have a Tensorflow tensor. How do I get the dimensions (shape) of the tensor as integer values? I ... 'Dimension' instead. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...