Chapter 3 Notebook
Writing data with Python¶
In [1]:
Copied!
import csv
import csv
In [2]:
Copied!
output = open('data/myCSV.csv',mode='w')
mywriter=csv.writer(output)
# define a header and write to file
header = ['name','age']
mywriter.writerow(header)
# write some data to the file
data = ['Bob Smith', 40]
mywriter.writerow(data)
output.close()
output = open('data/myCSV.csv',mode='w')
mywriter=csv.writer(output)
# define a header and write to file
header = ['name','age']
mywriter.writerow(header)
# write some data to the file
data = ['Bob Smith', 40]
mywriter.writerow(data)
output.close()
Write more data¶
In [3]:
Copied!
from faker import Faker
from faker import Faker
In [4]:
Copied!
output = open('data/data.csv',mode='w')
fake = Faker()
header = ['name', 'age','street','city','state','zip','lng','lat']
mywriter= csv.writer(output)
mywriter.writerow(header)
for i in range(1000):
mywriter.writerow([fake.name(),
fake.random_int(min=18, max=80, step=1),
fake.street_address(),
fake.city(),
fake.state(),
fake.zipcode(),
fake.longitude(),
fake.latitude()])
output.close()
output = open('data/data.csv',mode='w')
fake = Faker()
header = ['name', 'age','street','city','state','zip','lng','lat']
mywriter= csv.writer(output)
mywriter.writerow(header)
for i in range(1000):
mywriter.writerow([fake.name(),
fake.random_int(min=18, max=80, step=1),
fake.street_address(),
fake.city(),
fake.state(),
fake.zipcode(),
fake.longitude(),
fake.latitude()])
output.close()
Reading data using python¶
In [5]:
Copied!
with open('data/data.csv') as f:
my_reader=csv.DictReader(f)
headers = next(my_reader)
for row in my_reader:
print(row['name'])
with open('data/data.csv') as f:
my_reader=csv.DictReader(f)
headers = next(my_reader)
for row in my_reader:
print(row['name'])
John Arnold Lauren Johnson Haley Ford Amber Mejia Rachel Randall Sherri Lopez Dawn Johnson Jeffrey Dean Jason Moore Jenna Freeman Nicole Flores Timothy Smith Michelle Chapman Margaret Harris Gregory Taylor James Lee Melissa Campbell Samantha Love Barbara Mccarthy Robert Frazier David Butler Greg James Michael Gonzalez Tony Brown Paige Carr Lisa Hansen Lisa Rogers Kaylee Perez Crystal Barnett Natalie Olson Teresa Gordon Wendy Thomas Michael Baird Paula Martinez David King Tammy Hernandez Kelly Ryan Peter Griffin Anne Logan Sheryl Chung Patricia Hayes Jonathan Adams Kimberly Brown Gregory Ellis Terri Smith Matthew Love II Danny Jones Charles Edwards Lauren Brown Ashley Hernandez Carolyn Drake Jeremy Barr Andrea Vasquez Sandra Morris Travis Robertson Kimberly Murphy John Kline Michael Young Gregory Ortega Brittany Salinas Denise Jones Dylan Clarke Amber Gallagher Robert Armstrong Troy Norris Mr. Kenneth Molina Sheri Martin Brittany Davis John Blair James Gallegos Teresa Harrison Charles Mitchell Haley Riley Amanda Morales Anthony Myers Sara Vasquez Michael Jordan Ashley Chavez Joseph Hernandez David Walker Joseph Lewis Ryan Greene Nancy Hebert Terry Warner Dylan Woodard William Martinez Natalie Nguyen Kelly Murray Dylan Humphrey James Hebert Lisa Mcclain Brandon Williams Edward Lynch Elizabeth Sanchez Valerie Taylor John Thomas Dwayne Crosby Kathleen Dalton Jason Ramirez Timothy Robles Ronnie Padilla Jeffrey Thomas Aaron Peters Scott Lester Matthew Harmon Rhonda Morgan Allison Aguilar Thomas Sanders Michael Fields Christine Perez Lauren Mason Daniel Barnes Donald Soto Jeremy Collins Leslie Ibarra Travis Logan Kaitlyn Novak Shelby Smith Alexander Moore Amy Foster Eric James Savannah Anderson Chad Chavez Tracey Wilson Heather Leonard Paul Jones Christopher Jones Joanna Gallagher James Boyd Hayden Fields Erica Bell Deborah Hill Alicia Taylor Bruce Evans Richard Norris MD Jamie Hubbard Danielle Hill Alexis Petersen Tina Jackson Mary James Tim Hall Donald Strickland Anne Reed Mariah Rodriguez Jacob Simpson Mallory Bradley Matthew Avila Brandon Jackson Beth Herrera John Scott Mackenzie Stout Ethan Miller Adam Leonard Laurie Cook James Rodriguez Laura Randall Gerald Robinson Patricia Powell Henry Vasquez Dr. Leah Davidson Rebecca Craig Emily Williams Jared Davis Mary Ortega Ashley Padilla Robert Richardson Michael Gonzalez Lydia Walter Christy Roy Michael Ward Nathan Stevens Emily Buchanan Brian Bradley Maria Wyatt Oscar Murphy James Thompson Katie Norman Alyssa Shah Katelyn Johnson Catherine Harrison Taylor Crawford Anna Quinn Brandi Foster David Gilbert Mark Davis Jeffrey Murphy Maxwell Townsend Vanessa Daniels Brianna Wright Shannon Miller John Ramirez Matthew Galvan Kaitlin Garcia Harold Miller Patricia Peters Mary Turner Jessica Lee William Randall Julie Rivera Lauren Guerrero Bethany Stewart Cindy Obrien Brandon Brady Jessica Chapman Holly Jones Theodore Gallegos Kelly Vance Brian Cardenas Gregory Wood Mark Rogers Sabrina Mcclure DVM John Thornton Olivia Coffey Amanda Young Patrick Glover Mary Hansen Daniel Martinez Michelle Collins Robert Cervantes James Ellis Jamie Cooper Deborah Fowler Danielle Sanders Jessica Hill Kathy Jones Joshua Oconnor Cameron Vega Clinton Brown Samuel Thomas Larry Williams April Clark David Benson Kelly Garza Christopher Gill James Mendez Anita Goodman Steven Cruz Michele Michael Robert Salas Angela Ibarra Ana Higgins Martin Johnson Patrick Hill Denise Torres Jodi James Nicole Smith Mary Gross Denise Bryant Connie Martinez Ian Marquez Michael Schultz Alexandra Guzman Courtney Werner Shelia Dudley Hannah Rodriguez Denise Herman Emily Miller Joshua Kelley Heather Aguirre Michelle Hill Zachary White David Lee Joan George Lauren Dyer Amber Fowler Jeffrey Smith Stephanie Nguyen William Mann Robin Anderson Brian Camacho Jane Smith Edward Banks Bryan Morales Tony Sanchez Caleb Baird Danielle Mckenzie Anna Berry MD Douglas Collins Carolyn Gomez Allison Ross Allison Blake Bryan Burke Kevin Daniels Toni Allen Andrew Wood Jim Dunn Jeffery Brown Daniel Fletcher Mrs. Tina Allen MD Dawn Pugh Jennifer Roberts Stacey Shaw Christopher Perkins Catherine Alvarez Christina Mills Melissa Smith Hannah Hopkins Virginia Baker Angela Bailey Nathaniel Jensen Sharon Cross Richard Branch Eric Moore Terri Baker Collin Harrington Christina Walker Patricia Robinson Wesley Scott Jason Richard Kevin Mason Caleb Obrien Rachel Turner MD Jill Lambert Roberto Phillips Lauren Flores Steven Leon Brian Brown Jimmy Roberts Katherine Haynes Nicholas Fisher William Spence Tonya Scott Jordan Hicks Brent Berg Michael Garza Daniel Fuentes Diana Underwood Jennifer Ritter Sherry Miller Rhonda Cantu Sharon Daniel Ashley Ruiz Kelly Kennedy Amy Chapman Dawn Tapia Courtney Thomas Gina Logan Connie Valenzuela Mary Villegas Jessica Nguyen Robin Hunt Yvette Santos Daniel Lewis Kristen Oconnell Misty Johnson Christopher Miller DDS Sierra Floyd Juan Castillo Joseph Lozano Jonathan Baker Jeffrey Morales Erica Roberts Lori Scott Michael Wood Katelyn Smith Ann Soto Linda Landry Randall Contreras Danielle Diaz Joanna Morris Michelle Abbott Megan Walton Melissa Vincent Jason Morton Johnathan Quinn Christine Clark Douglas Swanson Lisa Bolton Lisa Oliver Travis Evans Regina Swanson Terry Galvan Scott Bradley Shane Crosby Jenna Branch Stephanie Gonzales Tiffany Drake Patricia Vincent Crystal Garcia Lori Rios Brian Hanna Tammy Porter Kara Lewis Heather Holmes Wendy Thomas Edward Smith Brenda Cruz Jose Bailey Tina Sanchez Vanessa Garcia Deborah Quinn April Moore Taylor Johnson Kathy Wilson Catherine Martinez Sarah Wilson Lori Brock Mark Taylor Justin Campbell Terry Mcgrath Mark Crawford Brenda Watson Adam Barker Kathleen Brown Glen Tyler Mr. John Kline Paige Robinson Tabitha Snyder Kenneth Campbell Robert Hayden Sherry Cooper Ryan Robinson Jennifer Velasquez Dean Webb Jaclyn Morales Rebecca King Mary Miller Jaime Diaz Taylor Gill Tammy Stanton Monica Perez Steven Hayes Stephanie Navarro Teresa Lambert Larry Mcdonald DDS Brian Boyer Jeremy Horton Michelle Mann Anthony Skinner Miss Darlene Strickland MD Ana Wolfe Charlotte Jefferson Lynn Walton Theresa Griffin Aaron Dyer Laura Fisher Sherri Giles David Cook Adam Smith Tracey Johnston Daniel Wilson Ryan Evans Matthew Cunningham Lindsay Thomas Kari Miller Jeffrey Wilson Joseph Neal Randall Garcia Katelyn Davis Annette Meyer Brian Terry Tiffany Powell Wanda Rivera Sarah Herring Rebecca Mccarthy Robin Morales Nicole Davis Eric Rivera Brian Khan Katherine Roberts Sean Nicholson Tracey Gibbs Heather Carr Harry Watts Cathy Neal Nancy Reed Nicholas Rodgers Brian Scott Matthew Grant Donald Greene Sarah Kane Philip Smith Russell Simmons Kenneth Espinoza Jacqueline Davis Christopher Franco Theresa Carter Stephanie Saunders Kelly Green Sabrina Miller Anthony Garcia Andrea Ruiz Robert Richmond Anthony Li Mary Holden Patricia Campbell Caitlin Kim Anthony Adams April Madden Derek Jones Richard Mcgrath Kristina Wagner Jose Sullivan Chelsea Roman Tracy Evans Kevin Bradford Kayla Avila Janice Petersen Ashlee Fischer Zachary Garrett Rachel Arnold Shelby Blair DVM Dustin Page Nicholas Robinson Tammy Collins Michael Cook Cheryl Chapman Penny Kelly John Jarvis Katelyn Adams Pamela Randall Michael Wilkins Christopher Bates Megan Bush David Navarro Abigail Walter Samuel Lin Brenda Rodriguez Michael Padilla Cynthia Clay Mark Brewer Allen Robles Christine Baker Zachary Ewing David Collins Angela Brown Gregory Griffin Cindy Walker James Lopez Gabriela Santiago Crystal Williams Jessica Mccoy Justin Williams Bryan Harrison John Harvey Patricia Mills Thomas Knight Sherry Martinez Dean Richardson Derrick Cooper Christopher Ibarra Sheri Stephens John Meyer Kelly Robinson Tammy Pratt Edwin Payne Christopher Vasquez Rebecca Lindsey Mr. Jonathan Bailey Jr. Zachary Kerr Cindy Watkins Jennifer Bradley Luis Benjamin Nicole Guzman Jessica Armstrong Scott Peters Mr. Robert Sharp Connie Galvan Gail Sutton Robert Mckee Lori Mclean Allison Weaver Charles Hernandez Rachel Acosta Bryan Weber Michael Garza Cindy Shelton Christina Cole Christina Sherman Christopher Rush Jerry Rodriguez Ruth Jones Erica Matthews Kyle Miller Corey Rios Theresa Smith Elizabeth Campos Lori Fletcher Monica Gallegos Matthew Holloway Brian Peterson Angela Martinez Amanda Wilcox Tracy Johnson Jennifer Ward Nancy Flores Alexandra Alvarado Andrew Smith Jennifer Wilson Wendy Allen Kenneth Wade Kayla Reed Tammy Hart Nathan Donovan Tracy Pena Michael Wright Fred Rosales Michael Beltran Maria Castaneda Jesus Alvarez Sherri Weber Mrs. Jennifer Gibson Jennifer Anderson Natasha Mays Tracey Steele Melanie Martinez Nancy Kemp Patrick Riley Steven Johnson Troy Rogers Angela Hawkins Gabriel King Kevin Hancock Jonathan Bowen Michael White Jr. Mary Valenzuela DDS Christopher Anderson Jeff Durham Mrs. Felicia Anthony Tammy Humphrey Heather Knox Jeremy Baker Emily Munoz Danny Sanchez Lauren Garcia Emily Harrell Bobby Mata James Walker Angela Jimenez Erin Whitney Ashley Carter April Cannon Lisa Nguyen Michael Flores Jonathan Johnston Stacey Carey Wendy Robinson Nancy Jackson Joshua Manning Kyle Joseph Audrey Hall Michael Dean Taylor Lindsey Sandra Williams Kevin Davis Matthew Cook William Campbell Emily Bonilla James Peterson Hannah Williams James Thomas Nicholas Holmes Timothy Lambert Latoya Walker Victoria Rivas Angelica Edwards Gabriel Moreno Dr. Ian Coleman Lee Perez Tina Rush Kyle Snyder David Paul Robert Williams Joseph Jenkins Richard Patrick Brenda Potter MD Debra Townsend Gail Schroeder Melissa Foster Stephen Rodriguez Denise Willis Sabrina Heath Michelle King Katherine Anderson Kimberly Ortiz Michael Garcia Dean Ramos Christopher Sutton James Lawson Karen Goodwin Lucas Sanchez Alan Montgomery Amanda Pearson Brandon Ray Michael Rivera Tamara Nelson Jay Vega Allison Baker Jesus Foster Samantha Miller Victor Crane Andrew White Christina Moore Megan Hayes Jeanette Lynch Kenneth Parks Mr. David Watkins Nicholas Navarro Jessica Stone David Hamilton Michele Bryant John Smith Larry Watson Erica Griffin Mark Carson Robert Allen Paul Ball Andrew Davis Stephanie Rodriguez Gary Castillo James Henry Kenneth Lee Antonio Anderson Lisa Hunter DDS Tracy Miller Joshua Williams Stephen Taylor Mark Hansen Theresa Obrien Belinda Butler Andrew Cook Monica Rice Bruce Hill Michele Smith Eric Waters Mark Edwards Amanda Williams Katherine Maxwell Amy White Julia Patel John Burton Jerry Cook Anna Sawyer Sean Hayes Marvin Flores Nathaniel Gordon Steven Mercado Joseph Ramirez Caitlin Nelson Kelli Garcia Megan White Victoria Neal Dr. Michael Jackson MD Tonya Young Maureen Sanders Shane Adams Vicki Morales Brady Nunez Cynthia Matthews Jennifer Hernandez Carolyn Oneal Jennifer Short Chelsea Woodward Jasmine Mason Mary Thomas Peter Morgan Mary Gutierrez Anthony Hartman Carolyn Mccoy Michelle Reynolds Rebecca Stone Danny Black Joseph Duran Sean Miller Kathryn Collier Barbara Mckee Joshua Young Dr. Rachael Flores Mario Shepard Stephen Harmon Erika Collier Deborah Martin Sean Nelson Paul Brennan Erica Moreno Joseph Martin Cory Joseph Zachary Sawyer Tiffany Chambers Beth Harrison Jennifer Yang Roger Haynes Melissa Huffman Javier Edwards Cory Coleman Julie Taylor Curtis Rivera Thomas Martin Victor Burton Taylor Anderson Nicholas Ortiz Robert Brown Mark Collins Todd Nelson Jordan Wright Eric Hernandez Johnathan Sampson Bridget Brown Craig Welch John Montoya Michael Garcia Gerald Bauer Kathleen Chavez Daniel Edwards Kendra Edwards Sandra Hansen Anita Conner Lauren Thornton Lee Kennedy Jennifer Crawford Madison Lee Theresa Jones Cynthia Ortega Mr. Larry Novak Diana Walker Gregg Sharp Sandra Davis John Garza Natasha Nguyen Aaron Gutierrez James Martin Tammy Todd Dr. Rita Mathews Alexander Smith Jerry Stewart Mary Thomas Tina Martin Daniel Johnson Chris Vasquez Sean Molina Charles Davis Carolyn Green Sara Branch John Choi Anthony Zavala Christine Smith Austin Kent William Dodson Amber Perry Lori Rivera Marc Collins Ashley Freeman Daniel Thomas Kristine Mora Julie Small Yolanda Mccormick Vanessa Walter Tommy Ramos Audrey Skinner Jessica Oneal Christina Fernandez Elizabeth Weaver Crystal Cabrera Rhonda Harrison Alexandra Yang Benjamin Johnson Christopher Lawrence Jason Grant Vernon Stewart Phillip Richard Matthew Hancock Sarah Johnson Travis Bradley Adam Bradley Brian Diaz Kathryn Garcia Kevin Steele Helen Hardy Jessica Cobb Ryan Ortiz Michael Moore Bill House Jerry Vaughn Colleen Cohen Judith Reed Sarah Mcbride David Lopez Ms. Caitlyn Fuller Heather Gregory Toni Mahoney Tyler Hood Joseph Johnson Kevin Lowe Paul Perez Pamela Goodwin John Bridges Anne Cline Julie Webster Patricia Meyer Heather Lara Maria Copeland Steven Diaz Lacey Williams John Smith Donald Townsend MD Daniel Floyd Michael Ware Spencer Cook Kevin Marsh Nicholas Barker Dennis Sexton Lauren Hunt Margaret Potts Thomas Mullins Michelle Potter Malik Lee Gina Hines Richard Dunn Chad Moss Alicia Mcguire Barbara Gonzalez Garrett Gomez David Martinez Ann Collins Tina Garcia Ashley Cobb Margaret Garcia Matthew Rodgers Scott Miller Nicole Nelson Jordan Farmer Michael Evans Antonio Jones Patrick Rosario Gary Shepard Darrell Butler Ashley Robbins Heidi Cross Sarah Lee MD John Owens Allen Hahn Rebecca Curtis Tracy Hood Aaron Cook William Cochran David Burgess DDS Shannon Davis Brian Green Hannah Chan Debbie Clark Jason Ross Nicholas Bennett James Byrd Evan Mitchell Kevin Lin William George Alexandria West Ronald Walton Kathryn Gibson Ashley Thompson Craig Diaz Meredith Moreno Rebecca Martinez Tami Gomez DVM Timothy Fitzgerald Amber Boyer Shannon Thomas Robert Nicholson Mark Wilson Sierra Mendez Thomas Robinson Benjamin Berg Beth Hansen PhD Mark Vance Anne Edwards William Taylor Tiffany Montoya Kristi Bowers Stacey Vance Valerie Bowman Donald Brooks Alexandra Walker Tammy Jones Wayne Davis Meghan Harris Bradley Watkins Elizabeth Flores William Lowe Ashley Terrell Leslie Kelly Curtis Howard Patrick Frazier Matthew Cook Charles Armstrong Jeffrey Jackson Mason Jackson Michelle Pearson Daniel Russell Donald Estes Jeffery Barton Angela Moore Elizabeth Nelson Jacob Stewart Curtis Carson Angel Banks Wendy Archer Teresa Evans Gregory Wall Dr. Kim Johnson DDS
read data with pandas¶
In [6]:
Copied!
import pandas as pd
data = pd.read_csv('data/data.csv')
data.head(10)
import pandas as pd
data = pd.read_csv('data/data.csv')
data.head(10)
Out[6]:
name | age | street | city | state | zip | lng | lat | |
---|---|---|---|---|---|---|---|---|
0 | Cody Reyes | 28 | 632 Maria Harbor | East Kimberly | Pennsylvania | 63385 | 141.224009 | -60.707198 |
1 | John Arnold | 31 | 6931 Day Ramp | Susanfurt | Colorado | 15091 | 76.027657 | 47.880438 |
2 | Lauren Johnson | 67 | 176 Guzman Flat | Anthonyville | Florida | 91204 | 169.393943 | -64.196078 |
3 | Haley Ford | 78 | 019 Tony Valley Apt. 518 | Lake Misty | Maryland | 27120 | -167.790774 | -46.305400 |
4 | Amber Mejia | 80 | 72779 Bowman Inlet Apt. 874 | Campostown | Minnesota | 71562 | -93.666926 | 26.613640 |
5 | Rachel Randall | 47 | 25775 Mueller Viaduct | South Shane | Maine | 68617 | -42.021006 | -58.606859 |
6 | Sherri Lopez | 43 | 4813 Nelson Neck Apt. 226 | Michaelstad | Maine | 8869 | 32.259509 | -15.350380 |
7 | Dawn Johnson | 20 | 531 Thomas Via | South Donnamouth | Maryland | 89055 | 101.252826 | -14.269343 |
8 | Jeffrey Dean | 50 | 08853 Deanna Squares Suite 490 | Thompsonview | Montana | 44519 | -149.628829 | -58.578460 |
9 | Jason Moore | 30 | 22056 Klein Road Apt. 240 | New Tanyatown | Connecticut | 63096 | -151.740439 | 47.402563 |
In [7]:
Copied!
# load data from a dictionary into a pandas dataframe
data={'Name':['Paul','Bob','Susan','Yolanda'],
'Age':[23,45,18,21]}
data = pd.DataFrame(data)
data.head()
# load data from a dictionary into a pandas dataframe
data={'Name':['Paul','Bob','Susan','Yolanda'],
'Age':[23,45,18,21]}
data = pd.DataFrame(data)
data.head()
Out[7]:
Name | Age | |
---|---|---|
0 | Paul | 23 |
1 | Bob | 45 |
2 | Susan | 18 |
3 | Yolanda | 21 |
In [8]:
Copied!
# save dictionary data to a csv file with pandas
data.to_csv('data/fromdf.CSV',index=False)
# save dictionary data to a csv file with pandas
data.to_csv('data/fromdf.CSV',index=False)
Writing JSON with Python¶
In [22]:
Copied!
from faker import Faker
import json
output = open('data/data.json', 'w')
fake = Faker()
all_data = {}
all_data['records'] = []
for x in range(10):
data = {"name":fake.name(),
"age":fake.random_int(min=18, max=80, step = 1),
"street":fake.street_address(),
"city":fake.city(),
"state":fake.state(),
"zip":fake.zipcode(),
"lng":float(fake.longitude()),
"lat":float(fake.latitude())}
all_data['records'].append(data)
json.dump(all_data, output)
from faker import Faker
import json
output = open('data/data.json', 'w')
fake = Faker()
all_data = {}
all_data['records'] = []
for x in range(10):
data = {"name":fake.name(),
"age":fake.random_int(min=18, max=80, step = 1),
"street":fake.street_address(),
"city":fake.city(),
"state":fake.state(),
"zip":fake.zipcode(),
"lng":float(fake.longitude()),
"lat":float(fake.latitude())}
all_data['records'].append(data)
json.dump(all_data, output)
In [23]:
Copied!
data
data
Out[23]:
{'name': 'Reginald Garrison', 'age': 78, 'street': '6878 Heather Via Apt. 189', 'city': 'Greenland', 'state': 'Arizona', 'zip': '96523', 'lng': 46.376531, 'lat': -8.5662505}
In [25]:
Copied!
with open('data/data.json', 'r') as f:
data = json.load(f)
data['records'][0]
with open('data/data.json', 'r') as f:
data = json.load(f)
data['records'][0]
Out[25]:
{'name': 'Clifford Wright', 'age': 55, 'street': '5635 Patterson Lodge', 'city': 'South Michael', 'state': 'Indiana', 'zip': '31511', 'lng': -76.574142, 'lat': -25.5054335}
In [26]:
Copied!
data['records'][0]['name']
data['records'][0]['name']
Out[26]:
'Clifford Wright'
Reading json with Python¶
In [34]:
Copied!
import pandas.io.json as pd_JSON
import pandas.io.json as pd_JSON
In [35]:
Copied!
f=open('data/data.json','r')
data=pd_JSON.loads(f.read())
f=open('data/data.json','r')
data=pd_JSON.loads(f.read())
In [29]:
Copied!
df=pd.json_normalize(data,record_path='records')
df=pd.json_normalize(data,record_path='records')
/home/fuzzy/.local/share/virtualenvs/data-engineering-with-python-wDbZ2OO0/lib/python3.7/site-packages/ipykernel_launcher.py:1: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead """Entry point for launching an IPython kernel.
In [31]:
Copied!
df.head()
df.head()
Out[31]:
name | age | street | city | state | zip | lng | lat | |
---|---|---|---|---|---|---|---|---|
0 | Clifford Wright | 55 | 5635 Patterson Lodge | South Michael | Indiana | 31511 | -76.574142 | -25.505433 |
1 | Eric Gordon | 70 | 03242 Larry Forest Apt. 483 | Salazarchester | Georgia | 68969 | -41.978282 | 45.043504 |
2 | Susan Moore | 18 | 730 Marilyn Route Suite 530 | Judithhaven | Delaware | 93096 | -75.336544 | 74.385857 |
3 | Brittany Thomas | 28 | 03853 Hess Alley Apt. 898 | Ginaberg | North Dakota | 98886 | 61.978988 | 76.393857 |
4 | Richard Jones | 71 | 4574 Spencer Harbor Apt. 352 | North Lori | Maine | 39370 | 86.406793 | -58.884639 |
In [ ]:
Copied!