title: I'm trying to figure out how to strip commas and dollars signs from my csv file
body: <p>I am currently working with csv files that deal with salaries.  I want to strip the dollar signs and the commas out so that I can convert the strings to ints. </p>
  
  <pre><code>import csv
  import numpy as np
  import random
  import pandas as pd
  from pandas import DataFrame
  import matplotlib.pyplot as plt
  
  phillies_of = pd.read_csv('/Users/hannahbeegle/Desktop/Teams/PHILLIES.csv', header = None)
  phillies_pr = pd.read_csv('/Users/hannahbeegle/Desktop/Teams/PHILLIES_PR.csv',header = None)
  
  phillies_pr.loc[:,7]= phillies_pr.loc[:,7].replace('$','')
  phillies_pr.loc[:,7]= phillies_pr.loc[:,7].replace(',','')
  filter = phillies_pr.loc[:,7]= ''
  phillies_pr.where(filter).dropna()
  fan_attendance = [int(i) for i in phillies_pr.iloc[:,7]]
  
  ERROR MESSAGE:
  Traceback (most recent call last):
    File "/Users/hannahbeegle/Desktop/Text Files/TeamDataBase.py", line 68, in &lt;module&gt;
      phillies_pr.where(filter).dropna()
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pandas/core/generic.py", line 8834, in where
      errors=errors, try_cast=try_cast)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pandas/core/generic.py", line 8572, in _where
      raise ValueError('Array conditional must be same shape as '
  ValueError: Array conditional must be same shape as self
  </code></pre>