How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • Go back-and-forth until satisfied
    Rate the answer you receive.
Ask Mark W Your Own Question
Mark W
Mark W, Consultant
Category: Programming
Satisfied Customers: 158
Experience:  BSc in Computer Science
106604827
Type Your Programming Question Here...
Mark W is online now

Need to plot histogram on python, with the program asking

This answer was rated:

need to plot histogram on python, with the program asking for user to type the name of the variable and it loops until user type exit
JA: What's your objective for this Python project?
Customer: its a tast task
JA: Anything else you want the programmer to know before I connect you?
Customer: none

Hi there,

I should be able to help with this.

What is it that you want to plot exactly?

Customer: replied 10 days ago.
Thanks Mark, I have a dataset with 10 different variables, so I want a script where 1. Ask user to type name of variable. 2. Histogram for the variable is displayed. 3. Type exit to end or input any variable name to view histogram

Is this what you are after?

Regards

Customer: replied 10 days ago.
i've run something similar but not working
while True:
label1 = input('Enter label 1 for plotting histogram (0 to exit):')
label1 = df[label1]
if label1 == "0":
print("Exiting the Program")
break
plot_graph(label1)

Can you attach your complete Python file as a .txt file?

(Using the paperclip icon)

Customer: replied 10 days ago.
It wont let me attach the file. Keep saying "
We're sorry – an unknown error occurred. Please try again."

Will it let you attach it as a Word document or a zip file?

Customer: replied 10 days ago.
ok, let me try
Customer: replied 10 days ago.
File attached (Q431TTG)

I can see an html page, but I can't see your code or any error message

Customer: replied 10 days ago.
i'm sorry, i've attched the wrong file.

I'm afraid I don't have jupyter installed. What error do you get when you run your code? What error do you get when you run my code?

Also I have tried installing jupyter, but it can't find the file MarketingCampaign.csv

Customer: replied 10 days ago.
I have actually run your code and its working correctly, let me try it will my dataset

Great, thanks for confirming my code worked correctly.

Customer: replied 10 days ago.
Thanks so much Mark, you are the best

You're welcome. If you could give me a positive rating, that would be great.

Feel free to ask me any new questions on https://www.justanswer.com/computer/expert-markbritish/

Regards

Mark

Mark W and other Programming Specialists are ready to help you
Many thanks for the bonus!