假设我有
import * as firebase from 'firebase';
@IonicPage()
@Component({
selector: 'page-login',
templateUrl: 'login.html',
})
export class LoginPage {
user = {} as User
async login(user: User){
try{
this.afAuth.auth.signInWithEmailAndPassword(user.email,user.password)
.then(res => {
//check if user has made profile if not send to profile setup page
let user = firebase.auth().currentUser;
if(user.emailVerified){ // note difference on this line
console.log("Email is verified");
}
}catch(e){
console.log(e);
}
}
}
我想获得列+----+---+
| v1| v2|
+----+---+
|-1.0| 0|
| 0.0| 1|
| 1.0| 2|
|-2.0| 3|
+----+---+
的最大绝对值,即v1
。谢谢!
答案 0 :(得分:5)
agg
与max
和abs
pyspark.sql.functions
使用import pyspark.sql.functions as F
df.agg(F.max(F.abs(df.v1))).first()[0]
# 2
:
import React, {Component} from 'react'
import { Field, reduxForm } from 'redux-form'
import { connect } from 'react-redux'
import { toJS } from './to-js'
import FormFieldA from './FormFieldA'
import FormFieldB from './FormFieldB'
class MainSearchForm extends Component {
render() {
return(
<form>
<FormFieldA options={this.props.fieldAoptions}/>
<FormFieldB options={this.props.fieldBoptions}/>
</form>
)
}
}
function mapStateToProps ({Search}, props) {
return {
fieldAoptions: Search.get('fieldAoptions'),
fieldBoptions: Search.get('fieldBoptions'),
}
}
MainSearchForm = connect(mapStateToProps,{})(toJS(MainSearchForm));
export default reduxForm({
form: 'main-search',
})(MainSearchForm)