I'm working with pandas for the first time and not sure if what I'm attempting is the best way to accomplish this, but I'm parsing an Excel sheet, trying to make a list of every number in a certain column (column 'C' in my case).
I returned everything from column 'C', removed the empty cells and now I'm trying to remove the '#' character that's in front of the numbers.
Here's my code from before I tried to remove the '#' character, so you can see the output:
def get_prod_cmvp_data():
prod_cmvp_data = pd.read_excel('_Request ID__Client Cryptographic Module List Template.xlsx', usecols = 'C', header = 6, )
prod_cmvp = prod_cmvp_data.dropna()
vals = prod_cmvp.values
print(vals)
output:
[['#3914']
[' #3907']
[' #3197']
['#4272']
['#4271']
['#4254']
['#3784']
['#3946']
['#3888']
['#4174']
['#4222']
['#3613']
['#3125']
['#3140']
['#3197']
[' #3196']
[' #3644']
[' #3615']
['#3651']
['#3918']
['#3946']
['#4271']
['#3888']
['#4174']
['#4222']
['#3613']
['#3125']
['#3140']]
Here's my code after I tried to remove the '#' character
def get_prod_cmvp_data():
prod_cmvp_data = pd.read_excel('_Request ID__Client Cryptographic Module List Template.xlsx', usecols = 'C', header = 6, )
prod_cmvp = prod_cmvp_data.dropna()
vals = prod_cmvp.values
values = vals.str.replace("#", "")
print(values)
Output:
AttributeError: 'numpy.ndarray' object has no attribute 'str'
Excel File:
Here's a link to the spreadsheet on google sheets, if that's any easier
https://docs.google.com/spreadsheets/d/1yBU4XrfMk54kQorOD7GCQ6kGBYzY_RGf10aHIKy4HLo/edit?usp=sharing
