diff --git a/pandas/script.py b/pandas/script.py index 97208c8..1ef75ec 100644 --- a/pandas/script.py +++ b/pandas/script.py @@ -14,4 +14,20 @@ pd.Series([30, 35, 40], index=['2015 Sales', '2016 Sales', '2017 Sales'], name='Product A') +#We'll use the pd.read_csv() function to read the data into a DataFrame. +wine_reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv") + +#We can use the shape attribute to check how large the resulting DataFrame is: +wine_reviews.shape + +#Output +(129971, 14) + +#We can examine the contents of the resultant DataFrame using the head() command, which grabs the first five rows: +wine_reviews.head() + +#You can see in this dataset that the CSV file has a built-in index, which pandas did not pick up on automatically. To make pandas use that column for the index (instead of creating a new one from scratch), we can specify an index_col. +wine_reviews = pd.read_csv("../input/wine-reviews/winemag-data-130k-v2.csv", index_col=0) + +