Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Noob question
#1
Hi, im new to Pandas, Python and all this awesomnes !

I learn hard way ...

I have few things im confused about.

Im trying to sort and visualize with graphs but separate by years.

df_mc = pd.DataFrame(df.groupby(['PMarket', 'PuYear']).size().reset_index())
        df_mc.columns = ['PMarket', 'PuYear', 'Count']

        fig1 = px.bar(df_mc, x="PMarket", y="Count", color='PMarket', range_y=[0,100])
But it shows me total of all years combined and selector wont work due to my "groupby function ?

Count column created by grouping. My range would be from 2000 but no end date and i want to do it for each month but cant find how to implement exact month as well.

So by the end of the day it should be - January - all data from January just need to be filtered by year with selector, next tab is February so same as January but February and so on. ( i have tabs already )

Also i would like to rename fields inside graph and be able to choose a year. I have a selector but it does nothing, my graph does not changes but if you look at THIS IMAGE it separates my bar with dotted line for each year.

Also - would it be safe to combine week 52 with week 53 if yes - how ? as far as i understand - week 52 is part of the week 53 or week 53 is part of week 52 and week 1 ?

Im also looking for info how to rename things inside charts as px.bar will show column name.
And also select Market and show on graph with all years . Lets say it shows all available years from earliest date available in my dat frame and i select area i want to look at to see difference between each year.
Add percentage difference from earliest year posible. I got game cd in 2000-1-1 next franchise came out 20010 and i got cd again but different price. i want to use my first CD as 100% and second cd price would show me a difference in percent - was it cheaper or more expensive .
I do all of this inside streamlit.

Thank You.
Reply


Messages In This Thread
Noob question - by BSDevo - Sep-07-2023, 05:19 AM
RE: Noob question - by snippsat - Sep-07-2023, 09:55 AM
RE: Noob question - by BSDevo - Sep-07-2023, 08:11 PM
RE: Noob question - by BSDevo - Sep-08-2023, 09:18 AM
RE: Noob question - by deanhystad - Sep-08-2023, 12:55 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020