🐍Python/Pandas

    [Pandas] Pandas03 - Regiment 풀이

    RegimentIntroduction:Special thanks to: http://chrisalbon.com/ for sharing the dataset and materials.Step 1. Import the necessary librariesIn [16]:import pandas as pd Step 2. Create the DataFrame with the following values:In [17]:raw_data = {'regiment': ['Nighthawks', 'Nighthawks', 'Nighthawks', 'Nighthawks', 'Dragoons', 'Dragoons', 'Dragoons', 'Dragoons', 'Scouts', 'Scouts', 'Scouts', 'Scouts']..

    [Pandas] Pandas03 - Occupation 풀이

    OccupationIntroduction:Special thanks to: https://github.com/justmarkham for sharing the dataset and materials.Step 1. Import the necessary librariesIn [1]:import pandas as pd Step 2. Import the dataset from this address.Step 3. Assign it to a variable called users.In [13]:url = 'https://raw.githubusercontent.com/justmarkham/DAT8/master/data/u.user' users = pd.read_csv(url,sep='|',index_col='use..

    [Pandas] Pandas03 - Alcohol_Consumption 풀이

    Ex - GroupByIntroduction:¶GroupBy can be summarizes as Split-Apply-Combine.Special thanks to: https://github.com/justmarkham for sharing the dataset and materials.Check out this DiagramStep 1. Import the necessary librariesIn [ ]:import pandas as pd Step 2. Import the dataset from this address.Step 3. Assign it to a variable called drinks.In [5]:url = 'https://raw.githubusercontent.com/justmarkh..

    [Pandas] Pandas02 - Fictional Army 풀이

    Fictional Army - Filtering and SortingIntroduction:This exercise was inspired by this pageSpecial thanks to: https://github.com/chrisalbon for sharing the dataset and materials.Step 1. Import the necessary libraries¶In [1]:import pandas as pd Step 2. This is the data given as a dictionaryIn [2]:# Create an example dataframe about a fictional army raw_data = {'regiment': ['Nighthawks', 'Nighthawk..

    [Pandas] Pandas02 - EURO12 풀이

    Step 1. Import the necessary libraries->import pandas as pd Step 2. Import the dataset from this address.Step 3. Assign it to a variable called euro12.-> euro12 = pd.read_csv('https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/02_Filtering_%26_Sorting/Euro12/Euro_2012_stats_TEAM.csv', sep=',') euro12 Step 4. Select only the Goal column.-> euro12.Goals A : 0 4 1 4 2 4 3 5 4 3 5 ..

    [Pandas] Pandas02 - Chipotle 풀이

    Step 1. Import the necessary libraries -> import pandas as pd import numpy as np Step 2. Import the dataset from this address. Step 3. Assign it to a variable called chipo. -> url = "https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv" chipo = pd.read_csv(url,sep='\t') Step 4. How many products cost more than $10.00? -> prices = [float(value[1 : -1]) for value in chipo.it..