Olympics Data Analysis | Data Analysis Project | Machine Learning with Deployment

In this video, I will be building an Olympics Data Analysis Web Application using Streamlit. For development, I will be using Python and Pandas. For plotting, I will be using Seaborn and Plotly libraries. The project will also be deployed to Heroku.
Live Demo: oda-campusx.herokuapp.com/
Dataset Link: www.kaggle.com/heesoo37/120-y...
Code Used: github.com/campusx-official/o...
============================
Do you want to learn from me?
Check my affordable mentorship program at : learnwith.campusx.in/s/store
============================
📱 Grow with us:
CampusX' LinkedIn: / campusx-official
CampusX on Instagram for daily tips: / campusx.official
My LinkedIn: / nitish-singh-03412789
Discord: / discord
E-mail us at support@campusx.in
⌚Time Stamps⌚
0:00 - Introduction
01:37 - Demo
09:10 - Dataset
10:32 - Setting up the Project
13:45 - Medal Tally
01:09:43 - Overall Analysis
01:43:50 - Country-wise Analysis
02:04:26 - Athlete Analysis
02:30:09 - Heroku Deployment
02:34:06 - Outro

Пікірлер: 180

  • @4549abhi
    @4549abhi2 жыл бұрын

    quite insightful video. Learned a lot from this. Thanks

  • @techtonik7
    @techtonik72 жыл бұрын

    Your pandas data manipulation skills are excellent. Thank you for the detailed analysis with good web app architecture.

  • @kadambaripatel1758
    @kadambaripatel1758 Жыл бұрын

    It was very helpful.Thanks!

  • @sandippatel6999
    @sandippatel69993 жыл бұрын

    very helpful make more video on this kind of project

  • @akhilgadwal7631
    @akhilgadwal76312 жыл бұрын

    one of the best project sir respect uh

  • @mariachibacon4534
    @mariachibacon45342 жыл бұрын

    Sir NaN region values most can be solved by replacing SIngapore as SGP instead of SIN. And adding TUV as Tuvalu. Only refugees team remains I hope you see this

  • @KastijitBabar
    @KastijitBabar23 күн бұрын

    Thank You so much, This helped me a lot.

  • @dswithanand
    @dswithanand2 жыл бұрын

    Thank u for this video…learned a lot from this..I hv one request ..can u plz make a video on multi class classification project..

  • @godhulimunshi1166
    @godhulimunshi11662 жыл бұрын

    Sir, your videos are really insightful, only after you brought to notice I got to know about the discrepancy in data...continue making such videos... I am eagerly waiting for videos on gradient boosting and Xgboost

  • @PIYUSH-lz1zq

    @PIYUSH-lz1zq

    2 жыл бұрын

    BRO , flask doesn't need then when streamlit is doing everthing ? when flask is useful ?

  • @_SaheliChakraborty
    @_SaheliChakraborty Жыл бұрын

    in the medal tally part when I am selecting a country with no medals..an empty table is coming instead of printing zeros..how to fix this

  • @pradipsah9900
    @pradipsah9900 Жыл бұрын

    sir, at 59:12 sec, in function fetch_medal_tally, you have mistakenly written 2016 instead of int(year) in 8th line of the function.

  • @mohammadarsalanadil1057
    @mohammadarsalanadil10572 жыл бұрын

    Thank you so much brother. U are doing really great thing. God bless u

  • @PIYUSH-lz1zq

    @PIYUSH-lz1zq

    2 жыл бұрын

    BRO , flask doesn't need then when streamlit is doing everthing ? when flask is useful ?

  • @BitsAndBytesAI

    @BitsAndBytesAI

    8 ай бұрын

    Prerequisites kiya hai is video ki explain anyone

  • @allrounder8699
    @allrounder86993 ай бұрын

    The heatmap before 2:00 hrs does not apply in all countries...wgen u select countries like aruba or some pther it give a error which I'm not able to understand

  • @gopikishan1028
    @gopikishan10282 жыл бұрын

    Hatts off to your efforts and time sir 👍 Thank you very much

  • @nishufatehiansari2264

    @nishufatehiansari2264

    Ай бұрын

    Hello ....... Friend , Kya aapka olympic wala project complete chuka hai , to mri help kar dijye please

  • @nishufatehiansari2264

    @nishufatehiansari2264

    Ай бұрын

    Bhut saari errors aa rahi hai , Kya mujhe aapka contact number mil sakta hai ? Agar aapko bura naa lage to ?

  • @shaileshmore2036
    @shaileshmore20362 жыл бұрын

    Thak. You sir nice video

  • @abhiavasthi624
    @abhiavasthi624 Жыл бұрын

    Completed. Thanks a lot for making this video. I can't imagine the effort you're putting in to make such videos for us.

  • @varungadani5540

    @varungadani5540

    Жыл бұрын

    did you completed full project seeing video or did you downloaded it from github

  • @abhiavasthi624

    @abhiavasthi624

    Жыл бұрын

    @@varungadani5540 yes completed on my own.

  • @varungadani5540

    @varungadani5540

    Жыл бұрын

    @@abhiavasthi624 if i got stuck anywhere will you help me? can you give me your linkedin username

  • @newtanagmukhopadhyay4716

    @newtanagmukhopadhyay4716

    Жыл бұрын

    @@varungadani5540 where you got stuck?

  • @varungadani5540

    @varungadani5540

    Жыл бұрын

    @@newtanagmukhopadhyay4716 completed the project , i got some some errors at end so write code of one graph

  • @nikitasinha8181
    @nikitasinha8181 Жыл бұрын

    Thank you so much sir

  • @Twentizz
    @Twentizz2 жыл бұрын

    Make project on prediction type of any dataset end to end with everything. I watched till end

  • @mellowftw
    @mellowftw2 жыл бұрын

    Sir can you please provide the jupyter notebook it will be really helpful I've just started learning data analysis

  • @tanishagrawal9091
    @tanishagrawal90914 ай бұрын

    Everytime i refresh the dataset giving error showing duplicate column names for Gold Silver Bronze

  • @rajaneeshray7502
    @rajaneeshray7502 Жыл бұрын

    hi sir, I am ficing issue at 1:21, I am not able to plot that graph , gone thru your updated code dont know why you guys are using col

  • @shriyak7872
    @shriyak78724 ай бұрын

    hii @CampusX I tried running this code, I wanted to created radio buttons just like you did, and I was trying to add select boxes but no matter what technique I use, I can either create a radio button or a slect box , but not both(like you have done) can you help me out please ?

  • @PIYUSH-lz1zq
    @PIYUSH-lz1zq2 жыл бұрын

    how can i streach my table ?... viewing medal tally table full column names are now showing !!

  • @naveenkumarjadi2915
    @naveenkumarjadi29153 жыл бұрын

    Great sir

  • @harshalpatil3744
    @harshalpatil37443 жыл бұрын

    Sir will you please make project on resume analysis ..in which if user upload the resume then model will tell how to improve resume

  • @shubhammurarka6589
    @shubhammurarka6589 Жыл бұрын

    we already have region name in team column so why are we merging region data from other file?

  • @vatsalyaa.m
    @vatsalyaa.m7 ай бұрын

    sir how to deploy this on RENDER ? what all do we have to mention in requirements.txt ?

  • @sonaganeshg3312
    @sonaganeshg3312 Жыл бұрын

    I'm getting preprocess has no attribute 'preprocess' error. Is this due to change in version. I'm using python 3.10 version.

  • @ashutoshkadam3845
    @ashutoshkadam384517 күн бұрын

    In my pycharm I don't have requirement. TXT section. Someone please help me out

  • @Twentizz
    @Twentizz2 жыл бұрын

    is it possible to combine 202 Tokyo Olympics too how to do that any ideas or clips to merger those

  • @sthitodhikarmakar2889
    @sthitodhikarmakar28895 ай бұрын

    Which algorithm is used to build this project

  • @gourabbiswas6961
    @gourabbiswas69615 ай бұрын

    how to attach csv files in pycharm project?

  • @rajankumar7668
    @rajankumar766815 күн бұрын

    Sir ,can I use VS code instance of pycharm for this project?

  • @saurabhbarasiya4721
    @saurabhbarasiya47213 жыл бұрын

    Great yrr

  • @mdjidmi8822
    @mdjidmi88223 жыл бұрын

    Great bro

  • @shadabmathematics9672
    @shadabmathematics96722 жыл бұрын

    Sir I follow you since last month ....and learn a lot.......I am learning data scn since last 6month ......my request is to make a video on "bike sharing demand"

  • @campusx-official

    @campusx-official

    2 жыл бұрын

    Will try

  • @PIYUSH-lz1zq

    @PIYUSH-lz1zq

    2 жыл бұрын

    BRO , flask doesn't need then when streamlit is doing everthing ? when flask is useful ?

  • @campusx-official

    @campusx-official

    2 жыл бұрын

    @@PIYUSH-lz1zq for building apis to serve for android apps

  • @user-ri9ge2pm4n
    @user-ri9ge2pm4n8 ай бұрын

    Sir how can we add medal prediction using algorithm also in this project

  • @krishnendubarman5998
    @krishnendubarman5998 Жыл бұрын

    Bro.. I am getting value error while refreshing the streamlit url. Please help 🙏

  • @46mithleshkumaryadav43
    @46mithleshkumaryadav43 Жыл бұрын

    Bhai 13:15 pr run krne se error aa rha TypeError: Plain typing.NoReturn is not valid as a type argument Bhai pls help to resolve it

  • @BeDesi1
    @BeDesi1 Жыл бұрын

    Thanks bro

  • @shadabmathematics9672
    @shadabmathematics96722 жыл бұрын

    Nitish sir can I get the jupyter notebook code .....so that I can practice

  • @ranirathore4176
    @ranirathore4176 Жыл бұрын

    Why does my streamline app kept on showing please wait.....

  • @RiyaSingh-yl3md
    @RiyaSingh-yl3md Жыл бұрын

    Sir application is showing some error. Can you please fix it ASAP.

  • @purvakulkarni5041
    @purvakulkarni5041 Жыл бұрын

    I am getting ImportError: FigureFactory.create_distplot requires scipy could yoy please help me out,sir? I have tried : 1) pip install scipy (didn't work) 2) import scipy (didn't work)

  • @aryanraina1932

    @aryanraina1932

    Жыл бұрын

    Import pyplot

  • @AmanSharma-jm2bl
    @AmanSharma-jm2bl2 жыл бұрын

    Can I get the jupyter notebook

  • @pranav9808
    @pranav98083 жыл бұрын

    Bhai your videos r awsome i recommended ur channel to almost everyone in my friend circle. Dont know why it dosnt giv your videos in the search result while seraching something relvent to ml. Can you please make a model for stock price prediction while coming to the timeseries. It will be a very useful and intresting project

  • @campusx-official

    @campusx-official

    3 жыл бұрын

    Sure

  • @PIYUSH-lz1zq

    @PIYUSH-lz1zq

    2 жыл бұрын

    BRO , flask doesn't need then when streamlit is doing everthing ? when flask is useful ?

  • @mohitkushwaha8974
    @mohitkushwaha8974 Жыл бұрын

    33.45 hrs- 230 rows se 205 rows kaise hua ??

  • @RanuBhasker6
    @RanuBhasker69 ай бұрын

    I am getting errors on running project can u help me in that

  • @achintkaur51
    @achintkaur513 жыл бұрын

    do u provide any courses

  • @pratikakole4853
    @pratikakole48532 жыл бұрын

    sir why didn't create machine learning model on this dataset. like logisticRegression, Support vector machine, linearregression, etc

  • @campusx-official

    @campusx-official

    2 жыл бұрын

    What is supposed to be predicted?

  • @newtanagmukhopadhyay4716
    @newtanagmukhopadhyay4716 Жыл бұрын

    hi sir, i did not quite understood what exactly beta_columns does. can someone please explain to me?

  • @aloktiwari2641

    @aloktiwari2641

    Жыл бұрын

    Same ..so I remove beta than its work😅

  • @Twentizz
    @Twentizz2 жыл бұрын

    is it possible to use prediction model on this project and predict upcoming stats of a character? I don't know how to use but this is my idea

  • @kuhusharma9600
    @kuhusharma9600 Жыл бұрын

    i keep getting the error : module 'streamlit' has no attribute 'beta_columns' can someone help me with that ?

  • @campusx-official

    @campusx-official

    Жыл бұрын

    Use columns instead of beta_columns

  • @6177_AdityaKumarPrajapati
    @6177_AdityaKumarPrajapati4 ай бұрын

    def most_successful(df,sport): temp_df = df.dropna(subset=['Medal']) if sport != 'Overall': temp_df = temp_df[temp_df['Sport'] == sport] return temp_df['Name'].value_counts().reset_index().head(15).merge(df,left_on='Name',right_on='count',how='left') Error: KeyError: 'count' can someone tell how to resolve it.

  • @BitsAndBytesAI
    @BitsAndBytesAI8 ай бұрын

    Prerequisites kiya hai is video ki explain anyone

  • @sreyag4766
    @sreyag47662 ай бұрын

    in first 30 min, did any one faced any problems regarding the medal column near gold,silver and bronze counts?

  • @jansigoswami8435

    @jansigoswami8435

    8 күн бұрын

    yes

  • @04adarshsingh47
    @04adarshsingh474 ай бұрын

    sir deploy me error aa Raha Hai

  • @pallavisadavarte6166
    @pallavisadavarte61663 жыл бұрын

    Sir this line " medal_tally = medal_tally.groupby('region').sum()[['Gold', 'Silver', 'Bronze']].sort_values('Gold', ascending=False).reset_index() " is giving error at 'region'... Please tell me how to resolve it?

  • @jaivik9093

    @jaivik9093

    2 жыл бұрын

    me also

  • @goatknowledge9428

    @goatknowledge9428

    Жыл бұрын

    me also, please give me a answer

  • @arindam_mahato

    @arindam_mahato

    Жыл бұрын

    After merging the datasets(athlete_events & noc_regions) assign the value into 'df' .....then run the above code

  • @siddharthparmar4329

    @siddharthparmar4329

    Жыл бұрын

    I am doing this project today and getting the same type of error

  • @siddharthparmar4329

    @siddharthparmar4329

    Жыл бұрын

    no no we have to merge the both csv then we have to save it in df again

  • @user-pz5gs5kv8k
    @user-pz5gs5kv8k10 ай бұрын

    At 25:18 I'm getting an error "FutureWarning: The default value of numeric_only in DataFrameGroupBy.sum is deprecated. In a future version, numeric_only will default to False. Either specify numeric_only or select only columns which should be valid for the function. df.groupby('NOC').sum()[['Gold','Silver','Bronze']]" KeyError: "None of [Index(['Gold', 'Silver', 'Bronze'], dtype='object')] are in the [columns]" Please help me with proper solution

  • @gopal1291

    @gopal1291

    10 ай бұрын

    df.groupby('NOC').sum()[['Gold', 'Silver', 'Bronze']].sort_values('Gold', ascending=False).reset_index() try this it will work

  • @RanuBhasker6

    @RanuBhasker6

    9 ай бұрын

    i am also getting this problem how to solve any one tell me

  • @user-se3nx9pv3k

    @user-se3nx9pv3k

    8 ай бұрын

    did you resolve it?

  • @gopal1291

    @gopal1291

    8 ай бұрын

    @@user-se3nx9pv3k yes

  • @krishnendubarman8490
    @krishnendubarman8490 Жыл бұрын

    raise ImportError("FigureFactory.create_distplot requires scipy") ------ showing this error while plotting distplot. Please give any solution.

  • @Rits-bt4zu

    @Rits-bt4zu

    7 ай бұрын

    pip install scipy

  • @adhipjajoo4892

    @adhipjajoo4892

    5 күн бұрын

    @@Rits-bt4zu It is still not working

  • @siddharthpawarshortschanne966
    @siddharthpawarshortschanne966 Жыл бұрын

    Can you create driver aggressive behaviour project

  • @RadhikaMantri-li3mm
    @RadhikaMantri-li3mm11 ай бұрын

    nations_over_time = df.drop_duplicates(['Year', col])['Year'].value_counts().reset_index( ).sort_values('index') I am getting error because of sort_values(index) keyword error

  • @Moonlight-1432

    @Moonlight-1432

    9 ай бұрын

    Same error

  • @Moonlight-1432

    @Moonlight-1432

    9 ай бұрын

    What's the solution

  • @realnamkha9974

    @realnamkha9974

    9 ай бұрын

    nations_over_time = df.drop_duplicates(['Year', col])['Year'].value_counts().reset_index().sort_values("Year") nations_over_time.rename(columns={'Year':'Edition','count':'No of countries'},inplace=True) return nations_over_time

  • @nishufatehiansari2264
    @nishufatehiansari22642 ай бұрын

    Streamlit has no attribute beta columns Please solution

  • @greenchilly7055

    @greenchilly7055

    26 күн бұрын

    Instead of st.beta_coloumns write st.columns

  • @078_rishujha8
    @078_rishujha8 Жыл бұрын

    scatterplot takes 0 to 1 arguments but 2 was given, error !

  • @nikitasinha8181

    @nikitasinha8181

    Жыл бұрын

    Write x= temp_df['Weight'] , y= temp_df['Height']

  • @yashjoshi3820
    @yashjoshi38202 жыл бұрын

    Sir I am having deployment issues. App not compatible with the buildpack is the issue I am facing, due to which the app is not being deployed. Please sir can you help me on it.

  • @someotherstuffs
    @someotherstuffs3 жыл бұрын

    Your videos are awesome!!!!! Sir a request! Can you please Make a tutorial on end to end project of Movie Recommendation system 🙏🏻

  • @campusx-official

    @campusx-official

    3 жыл бұрын

    kzread.info/dash/bejne/Y6yo1Kt-p7zFqrw.html

  • @someotherstuffs

    @someotherstuffs

    3 жыл бұрын

    @@campusx-official Thankyou so much Sir 🙏🏻

  • @PIYUSH-lz1zq

    @PIYUSH-lz1zq

    2 жыл бұрын

    BRO , flask doesn't need then when streamlit is doing everthing ? when flask is useful ?

  • @prabhatdangi9262
    @prabhatdangi92622 жыл бұрын

    Sir why can't heroku link of yours is not working ?

  • @campusx-official

    @campusx-official

    2 жыл бұрын

    Free server. Trial period over

  • @vamshireddyj2514
    @vamshireddyj2514 Жыл бұрын

    sir did you used django framework here

  • @anupamjha827

    @anupamjha827

    Жыл бұрын

    Streamlit

  • @rushi7x
    @rushi7x Жыл бұрын

    is this project used ml algorithms ? how can we say this project as ml project can anyone please explain !

  • @DsaDecoder

    @DsaDecoder

    Жыл бұрын

    NO, This is actually data analysis project. After processing the data only u can apply ml algorithms.

  • @rushi7x

    @rushi7x

    Жыл бұрын

    @@DsaDecoder can i say this project as ml project as no algorithm is used in it

  • @Robin_Tdhr

    @Robin_Tdhr

    Жыл бұрын

    @@rushi7x no you cant say ml project. You can present this as Data Analyis project

  • @acharjyaarijit
    @acharjyaarijit Жыл бұрын

    Thank you sir for this wonderful video. Sir Heroku is not free anymore.. can anyone please explain how to deploy this project on any other platform.

  • @pawankumar-ou7bz

    @pawankumar-ou7bz

    Жыл бұрын

    deploy in streamlit even they have their own setup to deploy

  • @BitsAndBytesAI

    @BitsAndBytesAI

    8 ай бұрын

    Prerequisites kiya hai is video ki explain anyone

  • @all_ez_well4743
    @all_ez_well4743 Жыл бұрын

    can anyone please tell how to paste the csv files into pycharm

  • @pallapranathi504

    @pallapranathi504

    Жыл бұрын

    just copy that file, n go to pycharm ,n tap on the folder you want to paste, and paste there.

  • @greenchilly7055
    @greenchilly705527 күн бұрын

    Instead of st.beta_coloumns write st.columns

  • @axhoang
    @axhoangАй бұрын

    genuine question is this in English? bc I do not understand a word you are saying

  • @jansigoswami8435

    @jansigoswami8435

    8 күн бұрын

    hindi + english

  • @sanjanasanju2449
    @sanjanasanju244911 ай бұрын

    Which algorithm is used here??

  • @gopal1291

    @gopal1291

    10 ай бұрын

    One hot encoding

  • @mellowftw
    @mellowftw2 жыл бұрын

    1:28:40

  • @secondarypemail7181
    @secondarypemail7181 Жыл бұрын

    Heroku ne free apps host karna hi nikal diya😥😥

  • @varunahlawat9013
    @varunahlawat9013 Жыл бұрын

    A Climate change analysis project.

  • @mellowftw
    @mellowftw2 жыл бұрын

    2:30:14

  • @everything_u_need1072
    @everything_u_need1072 Жыл бұрын

    Need subtitle

  • @pallapranathi504
    @pallapranathi504 Жыл бұрын

    KeyError: "['index', 'Name_x'] not in index" I'm getting this error

  • @ayushgajbhiye36

    @ayushgajbhiye36

    Жыл бұрын

    Same, did ur error got resolved? Plz reply bcz i'm stuck over there

  • @codingmo314

    @codingmo314

    Жыл бұрын

    @@ayushgajbhiye36 +1

  • @saranshjaiswal1420

    @saranshjaiswal1420

    Жыл бұрын

    just replace index by year and region with count pycham is name them year and count

  • @yashika67688

    @yashika67688

    Жыл бұрын

    @@saranshjaiswal1420 please ellaborate a little

  • @minhazriyam6272

    @minhazriyam6272

    11 ай бұрын

    Have you guys found the solutions?

  • @anubratamallick5502
    @anubratamallick55029 ай бұрын

    2:04:22

  • @devanshipokhriyal
    @devanshipokhriyal2 ай бұрын

    no

  • @everything_u_need1072
    @everything_u_need1072 Жыл бұрын

    Need in English

  • @anujkumar7943
    @anujkumar79433 ай бұрын

    KISI NE iss project ka ppt aur report tyar kaara kya ...college project ke liye ...bo please ,msgs krde

  • @humerashaikh3618
    @humerashaikh36183 жыл бұрын

    Can u share your LinkedIn profile pls

  • @campusx-official

    @campusx-official

    3 жыл бұрын

    www.linkedin.com/in/nitish-singh-03412789/

  • @yogindersyal802
    @yogindersyal8023 жыл бұрын

    Sir real estate project

  • @campusx-official

    @campusx-official

    3 жыл бұрын

    kzread.info/dash/bejne/doqszatqhtDWc84.html

  • @ImranAnsari-bx3qj
    @ImranAnsari-bx3qj2 жыл бұрын

    Please sir provide the Solution of this question .. 1) In which year india won First gold medal in summer Olympics? 2) which sport is having most female gold medal lists? 3) which events is most popular in term on Number of player? 4) which player has won most No. Gold medal of medals? 5) which player has won most No. of medals? 6) which sports is having most No. Of medals so far? 7) which sports is having most No. Of gold medal so far?

  • @kumarabhishek1064

    @kumarabhishek1064

    2 жыл бұрын

    You can find answers for this using simple pandas query like you do for sql.

  • @AdityaSingh-vd8kv
    @AdityaSingh-vd8kv4 ай бұрын

    def most_successful(df, sport): temp_df = df.dropna(subset=['Medal']) if sport != 'Overall': temp_df = temp_df[temp_df['Sport'] == sport] x = temp_df['Name'].value_counts().reset_index().head(15).merge(df, left_on='index', right_on='Name', how='left')[ ['index', 'Name_x', 'Sport', 'region']].drop_duplicates('index') x.rename(columns={'index': 'Name', 'Name_x': 'Medals'}, inplace=True) return x key error: 'index' plz help stuck in here from 5 days😢

  • @ankitakaushik1168

    @ankitakaushik1168

    3 ай бұрын

    def most_successful(df, sport): temp_df = df.dropna(subset=['Medal']) if sport != 'Overall': temp_df = temp_df[temp_df['Sport'] == sport] count_df = temp_df['Name'].value_counts().reset_index().head(20) count_df.columns = ['Name', 'Medals'] count_df['Medals'] = count_df['Medals'].astype(str) merged_df = pd.merge(count_df, df, left_on='Name', right_on='Name', how='left').drop_duplicates(subset='Name') result_df = merged_df[['Name', 'Medals', 'Sport', 'region']] result_df.rename(columns={'Name': 'Athlete'}, inplace=True) return result_df

  • @I-Umer
    @I-Umer25 күн бұрын

    def fetch_medal_tally(year, country): flag = 0 if year == 'Overall' and country == 'Overall': temp_df = medal_df elif year == 'Overall' and country != 'Overall': flag = 1 temp_df = medal_df[medal_df['region'] == country] elif year != 'Overall' and country == 'Overall': temp_df = medal_df[medal_df['Year'] == int(year)] elif year != 'Overall' and country != 'Overall': temp_df = medal_df[(medal_df['Year'] == int(year)) & (medal_df['region'] == country)] if flag == 1: x = temp_df.groupby('Year').sum()[['Gold', 'Silver', 'Bronze']].sort_values('Year').reset_index() else: x = temp_df.groupby('region').sum()[['Gold', 'Silver', 'Bronze']].sort_values('Gold', ascending=False).reset_index() x['Total'] = x['Gold'] + x['Silver'] + x['Bronze'] print(x) # Example call fetch_medal_tally(year='1956', country='Pakistan')

  • @khusbuu5625
    @khusbuu5625 Жыл бұрын

    Thank you Sir

  • @RanuBhasker6
    @RanuBhasker69 ай бұрын

    Bro.. I am getting value error while refreshing the streamlit url. Please help 🙏

  • @6177_AdityaKumarPrajapati
    @6177_AdityaKumarPrajapati4 ай бұрын

    def most_successful(df,sport): temp_df = df.dropna(subset=['Medal']) if sport != 'Overall': temp_df = temp_df[temp_df['Sport'] == sport] return temp_df['Name'].value_counts().reset_index().head(15).merge(df,left_on='Name',right_on='count',how='left') Error: KeyError: 'count' can someone tell how to resolve it.

  • @ankitakaushik1168

    @ankitakaushik1168

    3 ай бұрын

    def most_successful(df, sport): temp_df = df.dropna(subset=['Medal']) if sport != 'Overall': temp_df = temp_df[temp_df['Sport'] == sport] count_df = temp_df['Name'].value_counts().reset_index().head(20) count_df.columns = ['Name', 'Medals'] count_df['Medals'] = count_df['Medals'].astype(str) merged_df = pd.merge(count_df, df, left_on='Name', right_on='Name', how='left').drop_duplicates(subset='Name') result_df = merged_df[['Name', 'Medals', 'Sport', 'region']] result_df.rename(columns={'Name': 'Athlete'}, inplace=True) return result_df

  • @rajareddyraju6773
    @rajareddyraju67737 күн бұрын

    49:31

Келесі