|的意思是什么?用Java语言编写

时间:2018-09-22 17:55:27

标签: javascript operators

是什么?用Java语言做?它与逻辑或运算符||类似吗?我已经看到它显然用于将字符串转换为数字。如何运作?

var x = '12345';
var num = x|0;
console.log(num);

1 个答案:

答案 0 :(得分:2)

这是bitwise OR |。有时由于获取整数值而被误用(64位浮点数与32位整数)。

import pandas as pd

data = {'team': ['team1','team1','team1','team1','team1','team1','team1','team1','team1','team1','team1','team1','team1','team1',
              'team2','team2','team2','team2','team2','team2','team2','team2','team2','team2','team2','team2','team2','team2',],
     'score': [1,2,3,4,5,6,7,8,9,10,11,12,13,14,1,2,3,4,5,6,7,8,9,10,11,12,13,14],
     'yards': [10,20,30,40,50,60,70,80,90,100,110,120,130,140,10,20,30,40,50,60,70,80,90,100,110,120,130,140]}

df = pd.DataFrame.from_dict(data)