Does anyone know how to initiate the loop to read all the files below and count the row in each table and export the number in one table? I use jupyter notebook to run the python (3.8) and use pandas to manipulate the data. I want to count how many tweets per day during certain period. I used twint to retrive the information and want to analyze the data.
df01 = pd.read_csv("00_bitcoin_raw_2020-03.csv")
df02 = pd.read_csv("00_bitcoin_raw_2020-04.csv")
df03 = pd.read_csv("00_bitcoin_raw_2020-05.csv")
df04 = pd.read_csv("00_bitcoin_raw_2020-06.csv")
df05 = pd.read_csv("00_bitcoin_raw_2020-07.csv")
df06 = pd.read_csv("00_bitcoin_raw_2020-08.csv")
df07 = pd.read_csv("00_bitcoin_raw_2020-09.csv")
df08 = pd.read_csv("00_bitcoin_raw_2020-10.csv")
df09 = pd.read_csv("00_bitcoin_raw_2020-11.csv")
df10 = pd.read_csv("00_bitcoin_raw_2020-12.csv")
total_data_2020 = [len(df01),len(df02),len(df03),len(df04),len(df05),len(df06),len(df07),len(df08),len(df09),len(df10)]
df_2020 = pd.DataFrame(total_data_2020)
df_2020
source https://stackoverflow.com/questions/67759349/how-to-read-many-files-and-export-the-numbers-of-rows-in-one-table-using-pandas
Comments
Post a Comment