This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of the Paired Student's t-test | |
from scipy.stats import wilcoxon | |
# Randomly generate the data | |
x1 = rng.normal(loc=0.00, scale=1, size=100) | |
x2 = x1 + rng.normal(loc=0.25, scale=1, size=100) | |
# Calculate test statistic and p-value | |
stat, p = wilcoxon(x1, x2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import ttest_rel | |
# Randomly generate the data | |
x1 = rng.normal(loc=0.00, scale=1, size=100) | |
x2 = x1 + rng.normal(loc=0.25, scale=1, size=100) | |
# Calculate test statistic and p-value | |
stat, p = ttest_rel(x1, x2) | |
# Interpreation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import mannwhitneyu | |
# Randomly generate the data | |
x1 = rng.normal(loc=0.25, scale=1, size=100) | |
x2 = rng.normal(loc=0.00, scale=1, size=100) | |
# Calculate test statistic and p-value | |
stat, p = mannwhitneyu(x1, x2) | |
# Interpreatation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.stats import ttest_ind | |
# Randomly generate data | |
x1 = rng.normal(loc=0.25, scale=1, size=100) | |
x2 = rng.normal(loc=0.00, scale=1, size=100) | |
# Calculate test statistic and p-value | |
stat, p = ttest_ind(x1, x2) | |
# Interpreation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Campground = require('../models/campground'); | |
const Review = require('../models/review'); | |
const axios = require('axios').default; // axios.<method> will now provide autocomplete and parameter typings | |
module.exports.createReview = async (req, res) => { | |
// Retrieve the review and add the user ID | |
const review = new Review(req.body.review); | |
review.author = req.user._id; // store the user id from req which is provided by Passport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request | |
from flask_restful import Resource, Api, reqparse | |
import spacy | |
from spacytextblob.spacytextblob import SpacyTextBlob | |
nlp = spacy.load('en_core_web_sm') | |
nlp.add_pipe('spacytextblob') | |
app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask_restful import Resource, Api | |
app = Flask(__name__) | |
api = Api(app) | |
class HelloWorld(Resource): | |
def get(self): | |
return {'hello': 'world'} |
NewerOlder