Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,124 members, 7,957,216 topics. Date: Tuesday, 24 September 2024 at 09:17 AM |
Nairaland Forum / Ibromodzi's Profile / Ibromodzi's Posts
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (of 11 pages)
Programming / Re: I'm Getting An Error While I Run This Python Codes by ibromodzi: 2:27pm On Dec 07, 2019 |
ibromodzi: Problem solved. Thanks! |
Programming / Re: I'm Getting An Error While I Run This Python Codes by ibromodzi: 11:03am On Dec 07, 2019 |
stanliwise: I have stated it in my intro, the error is: DataFrame object is not callable when I tried to execute the last four lines of the code i.e # Create two new dataframes which are subsets of the original data Europe = un(un['Continent'] == 'Europe') Europe.reset_index(inplace = True) NorthAmericaa = un(un['Continent'] == 'North America') |
Programming / I'm Getting An Error While I Run This Python Codes by ibromodzi: 8:11am On Dec 07, 2019 |
Hello great programmers, I'm new to pandas so I just downloaded this data set from Kaggle.com to practice with. However the program throws an error saying Object DataFrame is not callable. The dataset can be found here. Here is the code import pandas as pd import numpy as np import researchpy as rp import scipy.stats import matplotlib.pyplot as plt un = pd.read_csv(r"C:\Users\ibrom\Documents\SAMPLE DATASET\Military Expenditure.csv" #To know the country with highest spending #first create a new column with total spending over the years un['Total Spending'] = un.iloc[:, 5:64].sum(axis=1) #sorting values to know the country with the highest and least spending un.sort_values('Total Spending', ascending = False) #filtering based on Type of region man = rp.summary_cat(un['Type']) man.reset_index() #grouyping the countries into continents and assessing their military spending over the year def continent(country): if country in ('Algeria','Angola','Benin','Botswana','Burkina Faso','Burundi', 'Cabo Verde','Cameroon', 'Central African Republic','Chad','Comoros', 'Congo, Democratic Republic of the','Congo, Republic of the','Cote d\'Ivoire','Djibouti','Egypt', 'Equatorial Guinea','Eritrea','Eswatini',' Ethiopia', 'Gabon','Gambia','Ghana', 'Guinea',"Guinea-Bissau", 'Kenya', 'Lesotho', 'Liberia', 'Libya', 'Madagascar', 'Malawi', 'Mali', 'Mauritania', 'Mauritius', 'Morocco', 'Mozambique', 'Namibia', 'Niger', 'Nigeria', 'Rwanda', 'Sao Tome and Principe' 'Senegal', 'Seychelles', 'Sierra Leone', 'Somalia', 'South Africa', 'South Sudan', 'Sudan', 'Tanzania', 'Togo', 'Tunisia', 'Uganda', 'Zambia', 'Zimbabwe'): return "Africa" elif country in ('Afghanistan', 'Armenia', 'Azerbaijan', 'Bahrain', 'Bangladesh', 'Bhutan', 'Brunei' 'Cambodia', 'China', 'Cyprus', 'Georgia' 'India' 'Indonesia' 'Iran' 'Iraq', 'Israel' 'Japan Jordan', 'Kazakhstan', 'Kuwait', 'Kyrgyzstan', 'Laos','Lebanon', 'Malaysia', 'Maldives', 'Mongolia', 'Myanmar (formerly Burma)', 'Nepal','North Korea', 'Oman', 'Pakistan', 'Palestine', 'Philippines', 'Qatar', 'Russia', 'Saudi Arabia', 'Singapore', 'South Korea', 'Sri Lanka', 'Syria', 'Taiwan', 'Tajikistan', 'Thailand', 'Timor-Leste','Turkey','Turkmenistan', 'United Arab Emirates (UAE)', 'Uzbekistan', 'Vietnam', 'Yemen, Rep'): return "Asia" elif country in ('Albania', 'Andorra', 'Armenia', 'Austria', 'Azerbaijan', 'Belarus', 'Belgium', 'Bosnia and Herzegovina', 'Bulgaria', 'Croatia', 'Cyprus', 'Czechia', 'Denmark', 'Estonia', 'Finland', 'France', 'Georgia', 'Germany', 'Greece', 'Hungary', 'Iceland', 'Ireland', 'Italy', 'Kazakhstan', 'Kosovo', 'Latvia', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Malta', 'Moldova', 'Monaco', 'Montenegro', 'Netherlands', 'North Macedonia', 'Norway', 'Poland', 'Portugal','Romania' 'Russia' 'San Marino' 'Serbia', 'Slovakia', 'Slovenia', 'Spain', 'Sweden', 'Switzerland', 'Turkey', 'Ukraine', 'United Kingdom', 'Vatican City'): return "Europe" elif country in ('Antigua and Barbuda', 'Bahamas', 'Barbados', 'Belize Canada', 'Costa Rica', 'Cuba', 'Dominica Dominican Republic', 'El Salvador', 'Grenada', 'Guatemala', 'Haiti', 'Honduras', 'Jamaica', 'Mexico', 'Nicaragua', 'Panama', 'Saint Kitts and Nevis', 'Saint Lucia', 'Saint Vincent and the Grenadines', 'Trinidad and Tobago', 'United States'): return "North America" elif country in ('Argentina', 'Bolivia', 'Brazil', 'Chile', 'Colombia', 'Ecuador', 'Guyana', 'Paraguay', 'Peru', 'Suriname', 'Uruguay', 'United States', 'Venezuela'): return "South America" elif country in ('Australia', 'Fiji', 'Kiribati', 'Marshall', 'Islands', 'Micronesia', 'Nauru', 'New Zealand', 'Palau', 'Papua New Guinea', 'Samoa', 'Solomon Islands', 'Tonga', 'Tuvalu', 'Vanuatu'): return "Australia / Oceania" # Creating the new column for continent un['Continent'] = un['Name'].apply(continent) # Create two new dataframes which are subsets of the original data Europe = un(un['Continent'] == 'Europe') Europe.reset_index(inplace = True) NorthAmericaa = un(un['Continent'] == 'North America') |
Programming / Re: Customized Laptop Skin by ibromodzi: 7:38am On Nov 27, 2019 |
Do you have for hp elite book mini? And can I get it in Ilorin? |
Programming / Re: Data Scientist Only by ibromodzi: 7:15pm On Nov 26, 2019 |
You are doing a good job. I'm still in the process of learning data analysis. I'll soon go into Machine Learning. |
Programming / Re: Chronicle Of A Data Scientist/analyst by ibromodzi: 5:17pm On Nov 17, 2019 |
Ejiod: Boss please is it possible to analyze likert scale data with python? If not what's the best way to do it? 3 Likes |
Programming / Re: Chronicle Of A Data Scientist/analyst by ibromodzi: 7:53am On Nov 11, 2019 |
I'm happy reading about bosses' narratives here. Really inspiring. Well, I started learning python last month and due to my experience with C++, I was able to learn with the speed of light Lol. So far I've mastered Numpy,Pandas, Matplotlib and a bit of Scipy, StatsModel and seaborn. I handled a mini project last week (a 'pseudo analysis' though, if there's anything like that) where I needed to read an excel file, make some analysis and visualize the results. It was really interesting working with the project. I'm currently delving into inferential statistics and I'll move on to machine learning later. I'll be glad if bosses here can guide me into a more distinctive path because I learn everything myself. Python is indeed powerful 35 Likes 2 Shares |
Programming / Re: Who Wants To Learn Programming In Python Easily Without Stress? READ THIS by ibromodzi: 4:26pm On Nov 03, 2019 |
081644029222 |
Programming / Re: Ethical Hacking And Penetration Testing For Educational Purposes by ibromodzi: 8:09pm On Oct 26, 2019 |
08164402922 |
Programming / Re: Python Tutorial Group by ibromodzi: 8:48am On Oct 06, 2019 |
08164402922 |
Science/Technology / Re: FGN Invites Recent 1st Class Graduates In Sciences And Engineering To TYSON by ibromodzi: 7:55am On Aug 09, 2019 |
imitateMe: What a dumb assertion! We have many Nigerians who are crypto developers, say only what you know. |
Politics / Re: Buhari Approves State, LG Police by ibromodzi: 6:06pm On Jun 03, 2019 |
isthatso: |
Politics / Re: Pictures From Swearing In Ceremony Of Atiku Bagudu In Kebbi State by ibromodzi: 6:25pm On May 29, 2019 |
Redeakaa: Nah |
Politics / Re: Pictures From Swearing In Ceremony Of Atiku Bagudu In Kebbi State by ibromodzi: 6:15pm On May 29, 2019 |
Almunjid: That's the fact bro... 1 Like |
Politics / Re: Pictures From Swearing In Ceremony Of Atiku Bagudu In Kebbi State by ibromodzi: 6:13pm On May 29, 2019 |
Redeakaa: Wow... I stay in Badariya 1 Like 1 Share |
Politics / Re: Pictures From Swearing In Ceremony Of Atiku Bagudu In Kebbi State by ibromodzi: 5:41pm On May 29, 2019 |
Redeakaa: Where do you stay in Kebbi? |
Education / Re: What Do First Class Graduates Do Different From Other 2.1 Students? by ibromodzi: 7:01pm On Mar 23, 2019 |
Durentt: There are five first class students in my class including myself with the first two being females. These girls are so accurate and precise when they answer questions, thus they tend to score higher marks. This always got me thinking and I would ask myself what's so extraordinary in them but I later got to find these; They don't joke with note taking in class which I am always lackadaisical about (since all our notes are in power points). They do their assignments the first day the lecturer gives them(as for me, I don't take assignments serious untill the last minutes). They do listen in class attentively( I don't usually care about this since the notes will be given out at the end of the classes) They are always the most active whenever they find themselves working in a group. Apart from these, I do read a lot because that's like a hobby to me. My CGPA was growing steadily from 100 level not until I tried to involve myself in a relationship in 400level first semester and this affected my result(I managed to have three As which was very rare of me), immediately I realized this I tightened my belt and made up for it in second semester, though my G.p fell from 4.62 to 4.57. Now in 500L My tactics; Whenever I'm reading for tests or exams, I do read the lecturer's mind(trying to make a mental map of the questions the lecturer is likely to ask). I do this carefully by rewriting the notes(no matter how bulky) in a jotter and revising it many times. 6 Likes 1 Share |
Politics / Re: Greatest Losers In This Elections.... by ibromodzi: 12:01am On Mar 11, 2019 |
SouthEastFacts: Oga you know nothing about Kwara for spewing this trash. |
Politics / Re: Opinion: INEC Should Ditch Paper Ballot For Online Elections. by ibromodzi: 12:11pm On Mar 10, 2019 |
grossintel: I get you. Like a voting system running on the blockchain |
Education / Re: Federal Government Scholarship (fsb 2018) Thread by ibromodzi: 10:35am On Feb 17, 2019 |
08164402922 Please add |
Foreign Affairs / Re: 16 Amazing Facts About Queen Elizabeth II by ibromodzi: 6:18pm On Feb 08, 2019 |
Is it true that she's kleptomaniac? 9 Likes |
Education / Re: Federal Government Scholarship (fsb 2018) Thread by ibromodzi: 2:43pm On Jan 22, 2019 |
08164402922 Add please |
Programming / Re: How Far Can I Code With My Phone? by ibromodzi: 9:24pm On Jan 13, 2019 |
greatface: Ok I will |
Programming / Re: How Far Can I Code With My Phone? by ibromodzi: 9:21pm On Jan 13, 2019 |
greatface: I'll try this out |
Programming / Re: How Far Can I Code With My Phone? by ibromodzi: 9:21pm On Jan 13, 2019 |
Ikennablue: Pm sent |
Phones / Re: How Do I Upgrade My Lumia 535 To Windows 10 by ibromodzi: 4:37pm On Jan 12, 2019 |
ItrendNaija: Lol |
Phones / Re: How Do I Upgrade My Lumia 535 To Windows 10 by ibromodzi: 4:37pm On Jan 12, 2019 |
rapthugx: I understand |
Programming / Re: How Far Can I Code With My Phone? by ibromodzi: 8:31am On Jan 12, 2019 |
Ikennablue: Wow! I'll like to know more about this. Can I send you a pm? |
Programming / Re: How Far Can I Code With My Phone? by ibromodzi: 6:27am On Jan 12, 2019 |
Towbaba500: Thanks but the question is how far can one go with these apps. I used to practice with cppdroid but had to stop because of my perceived limitations. For example, you can't make app with it |
Phones / Re: How Do I Upgrade My Lumia 535 To Windows 10 by ibromodzi: 2:16am On Jan 12, 2019 |
rapthugx:Thanks a bunch I'll do that once I get connected to WiFi |
Programming / Re: How Far Can I Code With My Phone? by ibromodzi: 10:39pm On Jan 11, 2019 |
Capnd143:I'm talking about IDE and other right tools for creating apps 1 Like |
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (of 11 pages)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 64 |