Generate table schema inspecting Excel(CSV) and import data

前端 未结 5 1555
盖世英雄少女心
盖世英雄少女心 2021-01-02 23:19

How would I go around creating a MYSQL table schema inspecting an Excel(or CSV) file. Are there any ready Python libraries for the task?

Column headers would be sani

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 23:42

    Pandas can return a schema:

    pandas.read_csv('data.csv').dtypes
    

    References:

    • pandas.read_csv
    • pandas.DataFrame

提交回复
热议问题