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 configparser import ConfigParser | |
import psycopg2 | |
import psycopg2.extras as psql_extras | |
import pandas as pd | |
from typing import Dict | |
def load_connection_info( | |
ini_filename: str | |
) -> Dict[str, str]: |
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 configparser import ConfigParser | |
import psycopg2 | |
from typing import Dict | |
def load_connection_info( | |
ini_filename: str | |
) -> Dict[str, str]: | |
parser = ConfigParser() | |
parser.read(ini_filename) |
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
data_counts <- unpivot_wide_data %>% | |
group_by(`Used Social Networks`) %>% | |
summarize(Frequency = n()) | |
# Order the data by descending order of the frequency | |
data_counts <- data_counts[ | |
order(data_counts$Frequency, decreasing = TRUE) | |
,] | |
# Order the X axis by the current order of the values in the "Frequency" column |
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
library(readr) | |
library(dplyr) | |
library(plotly) | |
library(tidyr) | |
library(stringr) | |
data <- read_csv("sample_data.csv") | |
max_split_cols <- max(mapply(str_count, data$`Used Social Networks`, ";"), na.rm = TRUE) + 1 |
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
library(readr) | |
library(dplyr) | |
library(plotly) | |
library(tidyr) | |
library(stringr) | |
data <- read_csv("sample_data.csv") | |
# Split and unpivot | |
# -------------------------------------- |
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
import quotespy.tweet_graphics.tweet_graphics as t | |
import os | |
# List of `tweet_info` dictionaries | |
USERNAME = "José Fernando Costa" | |
USERTAG = "@soulsinporto" | |
tweets = [ | |
{ | |
"tweet_name": "compare_to_others_sometimes", | |
"user_name": USERNAME, |
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
import quotespy.tweet_graphics.tweet_graphics as t | |
t.gen_tweets("samples\\tweets.json", {}, default_settings_format="light") |
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
[ | |
{ | |
"tweet_name": "mistakes", | |
"user_name": "José Fernando Costa", | |
"user_tag": "@soulsinporto", | |
"user_pic": "", | |
"tweet_text": "Some mistakes and, dare I say, failures may lead to results you had never thought you could achieve." | |
}, | |
{ |
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
import quotespy.tweet_graphics.tweet_graphics as t | |
tweet_info = { | |
"tweet_name": "mistakes", | |
"user_name": "José Fernando Costa", | |
"user_tag": "@soulsinporto", | |
"user_pic": "", | |
"tweet_text": "Some mistakes and, dare I say, failures may lead to results you had never thought you could achieve." | |
} | |
graphic_settings = { |
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
import quotespy.tweet_graphics.tweet_graphics as t | |
tweet_info = { | |
"tweet_name": "mistakes", | |
"user_name": "José Fernando Costa", | |
"user_tag": "@soulsinporto", | |
"user_pic": "samples\\user_photo.png", | |
"tweet_text": "Some mistakes and, dare I say, failures may lead to results you had never thought you could achieve." | |
} |