<jupyter_start><jupyter_text><jupyter_code># To keep the page organized do all imports here
from sqlalchemy import create_engine
import pandas as pd
from scipy import stats

# Database credentials
postgres_user = 'dabc_student'
postgres_pw = '<PASSWORD>'
postgres_host = '192.168.3.11'
postgres_port = '5432'
postgres_db = 'kickstarterprojects'

# use the credentials to start a connection
engine = create_engine('postgresql://{}:{}@{}:{}/{}'.format(
    postgres_user, postgres_pw, postgres_host, postgres_port, postgres_db))

projects_df = pd.read_sql_table('ksprojects', con=engine)

# remove the connection
engine.dispose()

#projects_df.shape

#describes column name and fill tyope
#projects_df.info()

#projects_df.head(2)

# count the number of unique values in this column
projects_df['category'].nunique()

# find the frequency of each value in the column
category_counts = projects_df['category'].value_counts()

# only print the first 10, because 158 are too many to print
#category_counts.head(10)

d<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1036468330134357, 'fraction_numerical': 0.02015355086372361, 'mean_word_length': 6.293706293706293, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '1679', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 358, 'n_tokens_neox': 340, 'n_words': 99, 'path': 'ksStatsPy.ipynb', 'repo_name': 'tastiz/story_scape.html', 'size': '1044'}