使用 csvkit 按列筛选数据
现在用 csvkit 的 csvcut 命令动手练习按列筛选数据。请记住,您可以通过列在文件中的位置(例如第 1 列、第 2 列)来筛选列,或通过数据文件中出现的列名精确筛选。
本练习是课程的一部分
Shell 中的数据处理
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Print a list of column headers in the data
csvcut -n Spotify_MusicAttributes.csv
# Print the first column, by position
csvcut -c ___ Spotify_MusicAttributes.csv