detect_encoding

 import chardet


def detect_encoding(filename:str) ->str:
    with open(filename,'rb') as f:
        raw_data=f.read()
        result=chardet.detect(raw_data)
        return result['encoding']

detect_encoding('data/directors.csv')

directors=pl.read_csv("data/directors.csv", encoding="EUC-JP")

评论

此博客中的热门博文

V2ray websocket(ws)+tls+nginx分流

Rstudio 使用代理