I'm trying to import all raw data (csv files) into one DataFrame, and since the raw data file have some useless lines, I like to delete them by "drop", however for the row with first column is a blank cell. I'm unable to delete it, and the dataframe doesn't recognize that column.
Here is my code:
import pandas as pd
import numpy as np
import glob
import os
#Determine file path for index weighting files
pathwgt=r'//10.27.36.181/etf/Bill/Quant/AxJ_Weight'
filenames = glob.glob(pathwgt + "/*.csv")
#declare data frame
dfwgt=pd.DataFrame()
#consolidate all files into one data frame
for filename in filenames:
dfwgt=dfwgt.replace('',np.NaN)
dfwgt=dfwgt.append(pd.read_csv(filename))
dfwgt=dfwgt.drop(['Symbol','Company'])
now my cell A1 in excel is blank, and B1 has a string, where I like to delete the entire row 1. The dataFrame shape is [124544 rows x 6 columns], where it suppose to be [124544 rows x 7 columns]