diff --git a/pandas_workout_hanan.md b/pandas_workout_hanan.md new file mode 100644 index 0000000..0333e90 --- /dev/null +++ b/pandas_workout_hanan.md @@ -0,0 +1,1365 @@ +# Publicly available datasets + + + +# Dataset 1: + +- Link: https://www.kaggle.com/emilynallen/top-20-songs-1970s2000s-w-audio-features?select=Top+20+All+Decades.csv +- Purpose: I would use this dataset of to find top 5 songs that where listen to during the time frame from 70s-80s + +# Dataset 2: + +- Link: https://www.kaggle.com/stefanoleone992/imdb-extensive-dataset +- Purpose: I would use this dataset of movies to find the a list of Crime movies made in the US. + +# Dataset 3: + +- Link: https://www.kaggle.com/zynicide/wine-reviews?select=winemag-data-130k-v2.csv +- Purpose: I would use this data set to find the List of wines that are made in france. + +# Dataset 4: + +- Link:https://www.kaggle.com/uciml/iris?select=Iris.csv +- Purpose: I would use this dataset to find out which species of the iris have the largest Petal length. + +# Dataset 5: + +- Link: https://www.kaggle.com/imls/museum-directory?select=museums.csv +- Purpose: I would use this dataset to find out what type of museums are most frequent in the United States. + + + +```python +import pandas as pd +``` + +# Dataset information + +## Dataset 1 : Top 20 songs from 1970s - 2000s + + +```python +dataset1 = pd.read_csv("top_20_music.csv") +``` + + +```python + +dataset1.head() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameArtistDecadeRankdanceabilityenergykeyloudnessspeechinessacousticnessinstrumentalnesslivenessvalencetempoduration_mstime_signatureCountryCity
0The TwistChubby Checker6010.5330.6384-7.1300.03410.2020.0000.07290.937156.6631537604United StatesPhiladelphia
1Hey JudeThe Beatles6020.4620.6325-7.4380.02480.0910.0000.39700.58574.2682388544EnglandLiverpool
2Theme from “A Summer Place”Percy Faith & His Orchestra6030.4660.3895-12.8250.02530.6310.8430.29500.74992.6311448934CanadaToronto
3Tossin’ and Turnin’Bobby Lewis6040.5690.7220-8.9140.03930.2550.0000.10800.965142.7361596404United StatesIndianapolis
4I Want to Hold Your HandThe Beatles6050.4900.7157-5.5490.04760.3860.0000.31100.866130.7261457474EnglandLiverpool
+
+ + + + +```python +dataset1.tail() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameArtistDecadeRankdanceabilityenergykeyloudnessspeechinessacousticnessinstrumentalnesslivenessvalencetempoduration_mstime_signatureCountryCity
94Whatever You LikeT.I.2000160.6800.6879-6.1620.07090.01610.0000000.2610.467150.0532495334United StatesAtlanta
95Bleeding LoveLeona Lewis2000170.6380.6565-5.8860.03570.18800.0000000.1460.225104.0362624674United KingdomLondon
96Independent Women, Part IDestiny’s Child2000180.7300.6026-3.7820.20600.36200.0000040.1690.92797.9542211334United StatesHouston
97FoolishAshanti2000190.4770.7280-5.7100.08310.35800.0000000.1100.69089.2092273874United StatesGlen Cove
98Hey Ya!Outkast2000200.7150.9700-2.2060.06480.06440.0001560.2050.96379.5042392404United StatesEast Point
+
+ + + +## Dataset 2 : IMDB Movie List + + +```python +import pandas as pd +``` + + +```python +dataset2 = pd.read_csv("IMDb_movies.csv") +``` + + +```python +dataset2.head() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
imdb_title_idtitleoriginal_titleyeardate_publishedgenredurationcountrylanguagedirector...actorsdescriptionavg_votevotesbudgetusa_gross_incomeworlwide_gross_incomemetascorereviews_from_usersreviews_from_critics
0tt0000009Miss JerryMiss Jerry18941894-10-09Romance45USANoneAlexander Black...Blanche Bayliss, William Courtenay, Chauncey D...The adventures of a female reporter in the 1890s.5.9154NaNNaNNaNNaN1.02.0
1tt0000574The Story of the Kelly GangThe Story of the Kelly Gang19061906-12-26Biography, Crime, Drama70AustraliaNoneCharles Tait...Elizabeth Tait, John Tait, Norman Campbell, Be...True story of notorious Australian outlaw Ned ...6.1589$ 2250NaNNaNNaN7.07.0
2tt0001892Den sorte drømDen sorte drøm19111911-08-19Drama53Germany, DenmarkNaNUrban Gad...Asta Nielsen, Valdemar Psilander, Gunnar Helse...Two men of high rank are both wooing the beaut...5.8188NaNNaNNaNNaN5.02.0
3tt0002101CleopatraCleopatra19121912-11-13Drama, History100USAEnglishCharles L. Gaskill...Helen Gardner, Pearl Sindelar, Miss Fielding, ...The fabled queen of Egypt's affair with Roman ...5.2446$ 45000NaNNaNNaN25.03.0
4tt0002130L'InfernoL'Inferno19111911-03-06Adventure, Drama, Fantasy68ItalyItalianFrancesco Bertolini, Adolfo Padovan...Salvatore Papa, Arturo Pirovano, Giuseppe de L...Loosely adapted from Dante's Divine Comedy and...7.02237NaNNaNNaNNaN31.014.0
+

5 rows × 22 columns

+
+ + + + +```python +dataset2.tail() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
imdb_title_idtitleoriginal_titleyeardate_publishedgenredurationcountrylanguagedirector...actorsdescriptionavg_votevotesbudgetusa_gross_incomeworlwide_gross_incomemetascorereviews_from_usersreviews_from_critics
85850tt9908390Le lionLe lion20202020-01-29Comedy95France, BelgiumFrenchLudovic Colbeau-Justin...Dany Boon, Philippe Katerine, Anne Serra, Samu...A psychiatric hospital patient pretends to be ...5.3398NaNNaN$ 3507171NaNNaN4.0
85851tt9911196De Beentjes van Sint-HildegardDe Beentjes van Sint-Hildegard20202020-02-13Comedy, Drama103NetherlandsGerman, DutchJohan Nijenhuis...Herman Finkers, Johanna ter Steege, Leonie ter...A middle-aged veterinary surgeon believes his ...7.7724NaNNaN$ 7299062NaN6.04.0
85852tt9911774Padmavyuhathile AbhimanyuPadmavyuhathile Abhimanyu20192019-03-08Drama130IndiaMalayalamVineesh Aaradya...Anoop Chandran, Indrans, Sona Nair, Simon Brit...NaN7.9265NaNNaNNaNNaNNaNNaN
85853tt9914286Sokagin ÇocuklariSokagin Çocuklari20192019-03-15Drama, Family98TurkeyTurkishAhmet Faik Akinci...Ahmet Faik Akinci, Belma Mamati, Metin Keçeci,...NaN6.4194NaNNaN$ 2833NaNNaNNaN
85854tt9914942La vida sense la Sara AmatLa vida sense la Sara Amat20192020-02-05Drama74SpainCatalanLaura Jou...Maria Morera Colomer, Biel Rossell Pelfort, Is...Pep, a 13-year-old boy, is in love with a girl...6.7102NaNNaN$ 59794NaNNaN2.0
+

5 rows × 22 columns

+
+ + + +## Dataset 3 : Wine Reviews + + +```python +import pandas as pd +``` + + +```python +dataset3 = pd.read_csv("winemag-data_first150k.csv") +``` + + +```python +dataset3.head() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unnamed: 0countrydescriptiondesignationpointspriceprovinceregion_1region_2varietywinery
00USThis tremendous 100% varietal wine hails from ...Martha's Vineyard96235.0CaliforniaNapa ValleyNapaCabernet SauvignonHeitz
11SpainRipe aromas of fig, blackberry and cassis are ...Carodorum Selección Especial Reserva96110.0Northern SpainToroNaNTinta de ToroBodega Carmen Rodríguez
22USMac Watson honors the memory of a wine once ma...Special Selected Late Harvest9690.0CaliforniaKnights ValleySonomaSauvignon BlancMacauley
33USThis spent 20 months in 30% new French oak, an...Reserve9665.0OregonWillamette ValleyWillamette ValleyPinot NoirPonzi
44FranceThis is the top wine from La Bégude, named aft...La Brûlade9566.0ProvenceBandolNaNProvence red blendDomaine de la Bégude
+
+ + + + +```python +dataset3.tail() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unnamed: 0countrydescriptiondesignationpointspriceprovinceregion_1region_2varietywinery
150925150925ItalyMany people feel Fiano represents southern Ita...NaN9120.0Southern ItalyFiano di AvellinoNaNWhite BlendFeudi di San Gregorio
150926150926FranceOffers an intriguing nose with ginger, lime an...Cuvée Prestige9127.0ChampagneChampagneNaNChampagne BlendH.Germain
150927150927ItalyThis classic example comes from a cru vineyard...Terre di Dora9120.0Southern ItalyFiano di AvellinoNaNWhite BlendTerredora
150928150928FranceA perfect salmon shade, with scents of peaches...Grand Brut Rosé9052.0ChampagneChampagneNaNChampagne BlendGosset
150929150929ItalyMore Pinot Grigios should taste like this. A r...NaN9015.0Northeastern ItalyAlto AdigeNaNPinot GrigioAlois Lageder
+
+ + + +## Dataset 4 : IRIS + + +```python +import pandas as pd +``` + + +```python +dataset4 = pd.read_csv("Iris.csv") +``` + + +```python +dataset4.head() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
015.13.51.40.2Iris-setosa
124.93.01.40.2Iris-setosa
234.73.21.30.2Iris-setosa
344.63.11.50.2Iris-setosa
455.03.61.40.2Iris-setosa
+
+ + + + +```python +dataset4.tail() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IdSepalLengthCmSepalWidthCmPetalLengthCmPetalWidthCmSpecies
1451466.73.05.22.3Iris-virginica
1461476.32.55.01.9Iris-virginica
1471486.53.05.22.0Iris-virginica
1481496.23.45.42.3Iris-virginica
1491505.93.05.11.8Iris-virginica
+
+ + + +## Dataset 5 : Museums + + +```python +import pandas as pd +``` + + +```python +dataset5 = pd.read_csv("museums.csv") +``` + + +```python +dataset5.head() +``` + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Museum IDMuseum NameLegal NameAlternate NameMuseum TypeInstitution NameStreet Address (Administrative Location)City (Administrative Location)State (Administrative Location)Zip Code (Administrative Location)...LatitudeLongitudeLocale Code (NCES)County Code (FIPS)State Code (FIPS)Region Code (AAM)Employer ID NumberTax PeriodIncomeRevenue
08400200098ALASKA AVIATION HERITAGE MUSEUMALASKA AVIATION HERITAGE MUSEUMNaNHISTORY MUSEUMNaN4721 AIRCRAFT DRANCHORAGEAK99502...61.17925-149.972541.020.02.06920071852201312.0602912.0550236.0
18400200117ALASKA BOTANICAL GARDENALASKA BOTANICAL GARDEN INCNaNARBORETUM, BOTANICAL GARDEN, OR NATURE CENTERNaN4601 CAMPBELL AIRSTRIP RDANCHORAGEAK99507...61.16890-149.767084.020.02.06920115504201312.01379576.01323742.0
28400200153ALASKA CHALLENGER CENTER FOR SPACE SCIENCE TEC...ALASKA CHALLENGER CENTER FOR SPACE SCIENCE TEC...NaNSCIENCE & TECHNOLOGY MUSEUM OR PLANETARIUMNaN9711 KENAI SPUR HWYKENAIAK99611...60.56149-151.215983.0122.02.06921761906201312.0740030.0729080.0
38400200143ALASKA EDUCATORS HISTORICAL SOCIETYALASKA EDUCATORS HISTORICAL SOCIETYNaNHISTORIC PRESERVATIONNaN214 BIRCH STREETKENAIAK99611...60.56280-151.265973.0122.02.06920165178201412.00.00.0
48400200027ALASKA HERITAGE MUSEUMALASKA AVIATION HERITAGE MUSEUMNaNHISTORY MUSEUMNaN301 W NORTHERN LIGHTS BLVDANCHORAGEAK99503...61.17925-149.972541.020.02.06920071852201312.0602912.0550236.0
+

5 rows × 25 columns

+
+ + + + +```python +dataset.tail() +``` + + + --------------------------------------------------------------------------- + + NameError Traceback (most recent call last) + + in + ----> 1 dataset.tail() + + + NameError: name 'dataset' is not defined + + + +```python + +```