Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
I may be slow to respond.

Emil Gadzhiyev emilgadzhiyev

🎯
I may be slow to respond.
View GitHub Profile
View code.php
add_action(
'hivepress/v1/models/listing/update',
function($listing_id) {
$listing = HivePress\Models\Listing::query()->get_by_id($listing_id);
if ($listing) {
$title = null;
// ЭТОТ КУСОК КОДА ДОЛЖЕН ДАТЬ МНЕ РОДИТЕЛЬСКУЮ КАТЕГОРИЮ - НЕ ДАЁТ
//if ($listing->get_categories()) {
// $title .= $listing->display_categories();
View code.php
add_action(
'hivepress/v1/models/listing/update',
function($listing_id) {
$listing = HivePress\Models\Listing::query()->get_by_id($listing_id);
if ($listing) {
$title = null;
// ТУТ НУЖНО НАЗВАНИЕ РОДИТЕЛЬСКОЙ КАТЕГОРИИ (НЕ ОК)
if ($listing->get_categories($get_parent_cats->name)) {
View layout.pug
//- Declaration
mixin layout
doctype html
head
meta(charset='UTF-8')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
title SAT - Welcome
link(rel='stylesheet' href='/src/style/index.scss')
.layout
.layout__left
View script.py
import codecademylib3_seaborn
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
# Load the passenger data
passengers = pd.read_csv('passengers.csv')
# Update sex column to numerical
View script.py
import codecademylib3_seaborn
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn import linear_model
df = pd.read_csv("https://content.codecademy.com/programs/data-science-path/linear_regression/honeyproduction.csv")
#print(df.head())
prod_per_year = df.groupby('year').totalprod.mean().reset_index()
#print(prod_per_year)
X = prod_per_year['year']
View script.py
import codecademylib3_seaborn
from matplotlib import pyplot as plt
import pandas as pd
import seaborn as sns
df = pd.read_csv('WorldCupMatches.csv')
df_goals = pd.read_csv('goals.csv')
df['Total Goals'] = df['Home Team Goals'] + df['Away Team Goals']
sns.set_style('whitegrid')
# sns.set_context('poster',font_scale=0.8)
View script.py
import codecademylib
from matplotlib import pyplot as plt
import pandas as pd
restaurants=pd.read_csv('restaurants.csv')
print(restaurants.head())
cuisine_options_count=restaurants.cuisine.nunique()
cuisine_counts=restaurants.groupby('cuisine').name.count().reset_index()
View script.py
import codecademylib3_seaborn
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
# Bar Graph: Featured Games
games=["LoL","Dota 2","CS:GO","DayZ","HOS","Isaac","Shows","Hearth","WoT","Agar.io"]
viewers= [1070,472,302,239,210,171,170,90,86,71]
plt.bar(range(len(games)), viewers, color='slateblue')
plt.title('Featured Games Viewers')
plt.legend(['Twitch'])
View test.sqlite
-- SELECT *
-- FROM chat
-- LIMIT 20;
-- SELECT DISTINCT game
-- FROM stream;
-- SELECT game
-- FROM stream
-- GROUP BY game;
-- SELECT channel
-- FROM stream
View Bar-Chart-with-Error.py
import codecademylib
from matplotlib import pyplot as plt
past_years_averages = [82, 84, 83, 86, 74, 84, 90]
years = [2000, 2001, 2002, 2003, 2004, 2005, 2006]
error = [1.5, 2.1, 1.2, 3.2, 2.3, 1.7, 2.4]
# Make your chart here
plt.figure(figsize=(10,8))
plt.bar(range(len(past_years_averages)), past_years_averages, yerr=error, capsize=5)