始める無料で始める

csvkit でファイルをスタックする

SpotifyData_PopularityRank6.csvSpotifyData_PopularityRank7.csv は、同じファイル形式、列順、そしてデータスキーマを持っています。ただし、一方にはランキング6位の楽曲情報、もう一方にはランキング7位の楽曲情報が含まれています。これら2つのファイルをスタックして、1つの統合ファイルにまとめてください。

この演習はコースの一部です

シェルでのデータ処理

コースを見る

演習の手順

  • SpotifyData_PopularityRank6.csvSpotifyData_PopularityRank7.csv をスタックしてください。スタック結果の出力をリダイレクトし、新しいファイル SpotifyPopularity.csv として保存します。

実践的なインタラクティブ演習

このサンプルコードを完成させて、この演習に挑戦してみましょう。

# Stack the two files and save results as a new file
___ SpotifyData_PopularityRank6.csv SpotifyData_PopularityRank7.csv ___ SpotifyPopularity.csv

# Preview the newly created file 
csvlook SpotifyPopularity.csv
コードを編集して実行