学习归类

import os
import re
import pathlib
from struct import *
import pandas as pd
import numpy as np
pathdir = "G:" 
files = np.array(os.listdir(pathdir))
#file_names = np.char.add(pathdir + "\", files)
file_names =[pathdir+"\"+f for f in files if re.search('.csv$',f)]


df_all["name"] = df_all["name"].str.replace("SH","1_")
df_all["begin"] = df_all["name"].map(str) + df_all["date"].map(str)
df_all = df_all.reset_index(drop=True)
df1 = pd.read_csv(file)
df_all = df_all.append(df1)
f3 = open(file,mode='rb')
buf = f3.read()


        date = unpack("I",buf[b:e-4])
        con = unpack("f",buf[b+4:e])
fw.write(pack("I",int(df_all.loc[i,"date"])))
fw.write(pack("f",df_all.loc[i,"content"]))




原文地址:https://www.cnblogs.com/rongye/p/13023984.html