makexu93
4/7/2019 - 4:53 PM

Create Dataset in Pandas from Scratch

import numpy
import pandas as pd
 
df = {
'ID': ['38229','88221', '12223', '45332', '90994', '43422', '45434', '55900', '54421', '78332'],
'Title': ['Avengers: Infinity War', 'Avatar', 'The Dark Knight', 'Your Name', 'Interstellar', 'Inception', 'Spirited Away', 'The Hangover', 'The Hangover Part II', 'Captain America: The Winter Soldier'],
'Production_Company':['Marvel Studios', 'Lightstorm Entertainment', 'Legendary Pictures', 'CoMix Wave Films', 'Legendary Pictures', 'Legendary Pictures', 'Studio Ghibli', 'Legendary Pictures', 'Legendary Pictures', 'Marvel Studios'],
'Year':['2018', '2009', '2008', '2016', '2014', '2010', '2001', '2009', '2011', '2014'],
'Genre':['Action', 'Adventure', 'Action', 'Fantasy', 'Science Fiction', 'Action', 'Fantasy', 'Comedy', 'Comedy', 'Action'],
'Budget':[400000000, 237000000, 185000000, '', 165000000, 160000000, 19000000, 35000000, 80000000, 177000000],
'Box_Office':[1814732959, 2787965087, 1004558444, 358000000, 677500000, 828300000, 289100000, 467500000, 586800000, 714300000],
'IMDB_Rating':[8.8, 7.8, 9, 8.4, 8.6, 8.8, 8.6, 7.7, 6.5, 7.8],
'Country':['USA', 'USA', 'USA', 'Japan', 'USA', 'USA', 'Japan', 'USA', 'USA', 'USA'],
'First_updated':['01/01/2017', '01/01/2017', '01/01/2017', '01/01/2017', '01/02/2017', '01/03/2017', '01/04/2017', '01/05/2017', '01/05/2017', '01/06/2017'],
'Last_updated':['05/21/2018', '02/11/2018', '01/12/2018', '04/11/2018', '03/16/2018', '03/17/2018', '03/18/2018', '03/18/2018', '03/18/2018', '03/19/2018']
}
 
mydata = pd.DataFrame(data=df)