df['manual_raw_value'][0:10]
Out[12]:
0 2
1 32
2 59
3 6635
4 1
5 5320
6 1548
7 34
8 29
9 854
Name: manual_raw_value, dtype: int64
df['raw_value'][0:10]
Out[13]:
0 2
1 32
2 59
3 6635
4 1
5 5320
6 1548
7 34
8 29
9 00Ô54
df['manual_raw_value'][0:10] == df['raw_value'][0:10]
Out[14]:
0 False
1 False
2 False
3 False
4 False
5 False
6 False
7 False
8 False
9 False
dtype: bool
例如,第一个单元格在两列中都等于2
答案 0 :(得分:2)
我认为有不同的dtypes - 一个是var content = document.getElementById('visibleContent').value + '<span id="more_text">' + document.getElementById('readMoreContent').value + '</span>',
function addArticle() {
var container = document.getElementById('article-content');
var html = '<ul>';
for (var i = 0; i < data.length; i++) {
html += '<li> <div class="demo-card-wide mdl-card mdl-shadow--2dp"> <div id="articleHeader'+i+'" class="mdl-card__title articleHeader"> <h2 id="articleTitle" class="mdl-card__title-text">' + data[i].doc.title + '</h2></div> <div id="articleContent" class="mdl-card__supporting-text item">' + data[i].doc.content + ' </div> <div class="mdl-card__actions mdl-card--border"> <button id="read_more" onclick="return showMore()" class="mdl-button mdl-js-button mdl-button--primary"> More... </button> <p id="time">' + data[i].doc.time + '</p><div class="mdl-card__menu"> <button class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect"> <i class="material-icons">share</i> </button> </div> </li>'
}
html += '</ul>'
container.innerHTML = html;
}
function showMore() {
var text = document.getElementById('more_text');
if (text.style.display === "block") {
text.style.display = "none";
} else {
text.style.display = "block";
}
}
,另一个是str
。
您可以通过以下方式查看:
int
如果需要转换列,则需要astype
:
print (df.dtypes)
将df['manual_raw_value'] = df['manual_raw_value'].astype(str)
中的所有值转换为DataFrame
:
str
或read_csv
中的参数df = df.astype(str)
,如果需要将所有列转换为dtype
:
str
或者可以指定列:
df = pd.read_csv('file', dtype=str)