Any idea why I can't remove a data frame field called "Type"? Is is a keyword? Is there anyway to delete it. When I included the line that is commented-out below, I get the error:
AttributeError: 'DataFrame' object has no attribute 'Type'
This is an CSV download from Paypal that has many more fields than I need, so I'm trying to keep just a few of them.
del df['Shipping Address']
del df['Address Status']
del df['Gross']
del df['Fee']
del df['Status']
del df['TimeZone']
#del df['Type'] # it doesn't want to delete this one
del df['Currency']
Dump of all the fieldnames:
['Date' 'Time' 'TimeZone' 'Name' 'Type' 'Status' 'Currency' 'Gross' 'Fee'
'Net' 'From Email Address' 'To Email Address' 'Transaction ID'
'Shipping Address' 'Address Status' 'Item Title' 'Item ID'
'Shipping and Handling Amount' 'Insurance Amount' 'Sales Tax'
'Option 1 Name' 'Option 1 Value' 'Option 2 Name' 'Option 2 Value'
'Reference Txn ID' 'Invoice Number' 'Custom Number' 'Quantity'
'Receipt ID' 'Balance' 'Address Line 1'
'Address Line 2/District/Neighborhood' 'Town/City'
'State/Province/Region/County/Territory/Prefecture/Republic'
'Zip/Postal Code' 'Country' 'Contact Phone Number' 'Subject' 'Note'
'Country Code' 'Balance Impact']
reference: Delete a column from a Pandas DataFrame