概要 分析のためにデータ集めしていると、たまに マジか!? と思うサイズの CSV に出くわすことがある。なぜこんなに育つまで放っておいたのか、、、? このエントリでは普通には開けないサイズの CSV を pandas を使ってうまいこと処理する方法をまとめたい。 サンプルデータ たまには実データ使おう、ということで WorldBankから GDPデータを落とす。以下のページ右上の "DOWNLOAD DATA" ボタンで CSV を選択し、ローカルに zip を保存する。解凍した "ny.gdp.mktp.cd_Indicator_en_csv_v2.csv" ファイルをサンプルとして使う。 http://data.worldbank.org/indicator/NY.GDP.MKTP.CD?page=1 補足 pandas の Remote Data Access で WorldBan
I have a pandas data frame and group it by two columns (for example col1 and col2). For fixed values of col1 and col2 (i.e. for a group) I can have several different values in the col3. I would like to count the number of distinct values from the third columns. For example, If I have this as my input: 1 1 1 1 1 1 1 1 2 1 2 3 1 2 3 1 2 3 2 1 1 2 1 2 2 1 3 2 2 3 2 2 3 2 2 3 I would like to have this
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く