Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- df = pd.read_csv('AppleStore.csv', sep=",")
- df.head()
- print(df['cont_rating'])
- while True:
- try:
- xvar = input("""Which X variable would you like to visualise?:
- 0\tApp price
- 1\tApp size
- 2\tGenre
- 3\tNumber of screenshots displayed in store
- 4\tExit program.
- """)
- while xvar == 0:
- yvar = input("""Which Y variable would you like to visualise?:
- 0\tUser rating
- 1\tNumber of user ratings
- 2\tContent rating
- 3\tExit program.
- """)
- if yvar == 0:
- [plot graph 1]
- break
- if yvar == 1:
- [plot graph 2]
- break
- if yvar == 2:
- [plot graph 3]
- break
- if yvar == 3:
- SystemExit
- break
- while xvar == 1:
- yvar = input("""Which Y variable would you like to visualise?:
- 0\tUser rating
- 1\tNumber of user ratings
- 2\tContent rating
- 3\tExit program.
- """)
- if yvar == 0:
- [plot graph 4]
- break
- if yvar == 1:
- [plot graph 5]
- break
- if yvar == 2:
- [plot graph 6]
- break
- if yvar == 3:
- SystemExit
- break
- while xvar == 3:
- yvar = input("""Which Y variable would you like to visualise?:
- 0\tUser rating
- 1\tNumber of user ratings
- 2\tContent rating
- 3\tExit program.
- """)
- if yvar == 0:
- [plot graph 7]
- break
- if yvar == 1:
- [plot graph 8]
- break
- if yvar == 2:
- [plot graph 9]
- break
- if yvar == 3:
- SystemExit
- break
- while xvar == 4:
- SystemExit
- break
- else:
- print("No valid input received.")
- continue
- except ValueError:
- print("Not a valid unit. ")
- continue
- # x variables: price, size_bytes, ipadSc_urls.num, prime_genre
- # y variables: user_rating, cont_rating, rating_count_tot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement