I have tried a number of ways to drop multiple columns in a csv using read_csv
and then save down the new csv (with the columns deleted), but none of them work. Here is my latest:
import pandas as pd
df = pd.read_csv('TradedInstrument_20230331_real.csv', sep='\t', encoding='unicode_escape')
df.drop(columns='stopTrdgAllowedInOpnFlag')
df.drop(columns='stopTrdgsAllowableInTrdg')
df.drop(columns='preTradeBlockThresholdChf')
df.drop(columns='billingSegmentCode')
df.drop(columns='preTradeBlockThresholdChf')
df.drop(columns='billingSegmentDesc').to_csv('output.csv', index=False)
This only removes the billingSegmentDesc
.