Computer Science > SOLUTIONS MANUAL > CS 400>unstructured_test (2).p (All)
#!/usr/bin/env python # coding: utf-8 # **Run the Cell to import the packages** # In[1]: import pandas as pd import numpy as np import csv # **Fill in the Command to load your CSV dataset "imdb... .csv" with pandas** # In[2]: #Data Loading imdb=pd.read_csv('imdb.csv') imdb.columns = ["index","text","label"] print(imdb.head(5)) # **Data Analysis** # # - Get the shape of the dataset and print it. # # - Get the column names in list and print it. # # - Group the dataset by **label** and describe the dataset to understand the basic statistics of the dataset. # # - Print the first three rows of the dataset # In[3]: data_size =imdb.size print(data_size) imdb_col_names =imdb.columns print(imdb_col_names) print( imdb.groupby('label').describe() ) print(imdb.iloc[:3] ) # **Target Identification** # # Execute the below cell to identify the target variables. If 0 it is a bad review,if it is 1 it is a good review. # # In[4]: imdb_target=imdb['label'] print(imdb_target) [Show More]
Last updated: 1 year ago
Preview 1 out of 6 pages
Connected school, study & course
About the document
Uploaded On
Apr 06, 2021
Number of pages
6
Written in
This document has been written for:
Uploaded
Apr 06, 2021
Downloads
0
Views
141
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·