Remove duplicates from table with string, datetime, double

7 ビュー (過去 30 日間)
Harry Lindner
Harry Lindner 2015 年 6 月 25 日
コメント済み: Sean de Wolski 2015 年 6 月 26 日
The data is attached, also below. If I remove duplicates in Excel, 4 rows of data get removed. None get removed using unique()
Thank you for the help!
Name,Date,Date2,N1,N2,N3,N4
Cat,11/30/2012,6/7/2010,-0.5,-0.005,-0.004227354,-0.005
Cat,11/30/2012,6/7/2010,1.8,0.0144,0.014572331,0.018
Cat,11/22/2013,6/7/2010,3.74013,0.0367,0.037401552,NaN
Cat,11/22/2013,6/7/2010,3.74013,0.0367,0.037401552,NaN
Cat,11/23/2013,6/7/2010,2.911714,0.0291,0.029116963,NaN
Cat,11/23/2013,6/7/2010,2.911714,0.0291,0.029116963,NaN
Cat,12/31/2010,6/7/2010,3.11296,0.0343,0.031767023,0.031767
Cat,12/30/2013,6/7/2010,2.462881,0.0242,0.024628875,NaN
Cat,12/30/2013,6/7/2010,2.462881,0.0242,0.024628875,NaN
Cat,12/31/2014,6/7/2010,1.887183,NaN,0.018871638,NaN
Cat,12/31/2014,6/7/2010,1.887183,NaN,0.018871638,NaN

採用された回答

Sean de Wolski
Sean de Wolski 2015 年 6 月 25 日
unique sees nans as not equal
isequal(nan,nan)
ans =
0
You'll need to replace them with something else or ignore that column.
  2 件のコメント
Harry Lindner
Harry Lindner 2015 年 6 月 25 日
How can I ignore those columns with unique (only focus on the first 2 columns is what I will eventually need)?
Thank you for the reply.
Sean de Wolski
Sean de Wolski 2015 年 6 月 26 日
unique(T(:,1:2),'rows')

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by