Advertisement
rajath_pai

Selecting specific value in column

Apr 11th, 2023
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. import os
  2. import numpy as np
  3. import pandas as pd
  4.  
  5. df = pd.read_csv('tripadvisor_hotel_reviews.csv')
  6.  
  7. df1 = df[df['Rating'] == 1]
  8.  
  9. print(df1.head())
  10.  
  11. df1.to_csv('onestar.csv', index = False)
Tags: python pandas
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement