Skip to content

Instantly share code, notes, and snippets.

@roshan-adusumilli
Created May 23, 2020 01:51
Show Gist options
  • Select an option

  • Save roshan-adusumilli/0d938e7d34c39d6e027778b6303a1033 to your computer and use it in GitHub Desktop.

Select an option

Save roshan-adusumilli/0d938e7d34c39d6e027778b6303a1033 to your computer and use it in GitHub Desktop.
import pandas as pd
ca_df = pd.read_csv('ca_labeled.csv', index_col=[0])
ny_df = pd.read_csv('ny_labeled.csv', index_col=[0])
tx_df = pd.read_csv('tx_labeled.csv', index_col=[0])
def features(value):
if(value == -1):
value = 'neg'
return value
elif(value == 1):
value = 'pos'
return value
else:
value = 'neu'
return value
ca_df['values'] = ca_df['values'].apply(features)
ny_df['values'] = ny_df['values'].apply(features)
tx_df['values'] = tx_df['values'].apply(features)
ca_df.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment