nlpforhealthcare18 / nlpforhealthcare18.github.io

This repo is to support collaborative code development for exploratory NLP analysis for health and social care research.
0 stars 4 forks source link

code to select cols from df #17

Open bailey-r opened 6 years ago

bailey-r commented 6 years ago

import pandas as pd

Selecting some of the features from the full data frame

selctd_ftrs=['report status','Overall rating for this service','Is the service safe?',\

   #    'Is the service effective?','Is the service caring?']

selctd_ftrs=['report status']

path='data/structured_data.csv' strctured_df=pd.read_csv(path,error_bad_lines=False,sep='\t') col_names=list(strctured_df) del strctured_df[col_names[0]] strctured_df.head() selctd_ftrs=['Overall summary','Background to this inspection',\ 'Action we have told the provider to take'] selected_df=strctured_df[selctd_ftrs]

print(selected_df)