This file contains 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 os | |
from IPython.display import Markdown | |
from crewai import Agent, Task, Crew | |
from crewai_tools import ScrapeWebsiteTool, SerperDevTool | |
from langchain_groq import ChatGroq | |
from dotenv import load_dotenv | |
from pydantic import BaseModel | |
load_dotenv() |
This file contains 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
Age | Sex | ChestPainType | RestingBP | Cholesterol | FastingBS | RestingECG | MaxHR | ExerciseAngina | Oldpeak | ST_Slope | HeartDisease | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
40 | M | ATA | 140 | 289 | 0 | Normal | 172 | N | 0 | Up | 0 | |
49 | F | NAP | 160 | 180 | 0 | Normal | 156 | N | 1 | Flat | 1 | |
37 | M | ATA | 130 | 283 | 0 | ST | 98 | N | 0 | Up | 0 | |
48 | F | ASY | 138 | 214 | 0 | Normal | 108 | Y | 1.5 | Flat | 1 | |
54 | M | NAP | 150 | 195 | 0 | Normal | 122 | N | 0 | Up | 0 | |
39 | M | NAP | 120 | 339 | 0 | Normal | 170 | N | 0 | Up | 0 | |
45 | F | ATA | 130 | 237 | 0 | Normal | 170 | N | 0 | Up | 0 | |
54 | M | ATA | 110 | 208 | 0 | Normal | 142 | N | 0 | Up | 0 | |
37 | M | ASY | 140 | 207 | 0 | Normal | 130 | Y | 1.5 | Flat | 1 |
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 29 columns, instead of 28 in line 4.
This file contains 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
Date,Abap,Ada,C/C++,C#,Cobol,Dart,Delphi/Pascal,Go,Groovy,Haskell,Java,JavaScript,Julia,Kotlin,Lua,Matlab,Objective-C,Perl,PHP,Python,R,Ruby,Rust,Scala,Swift,TypeScript,VBA,Visual Basic | |
July 2004,0.33999999999999997,0.36,10.08,4.71,0.43,0,2.82,0,0.03,0.22,30.37,8.649999999999999,0,0,0.16,2.11,0.19,7.380000000000001,18.75,2.53,0.38999999999999996,0.33,0.08,0.03,0,0,1.44,8.559999999999999 | |
August 2004,0.36,0.36,9.81,4.99,0.45999999999999996,0,2.67,0,0.06999999999999999,0.2,29.99,8.780000000000001,0,0,0.15,2.0500000000000003,0.18,7.109999999999999,19.259999999999998,2.64,0.41000000000000003,0.4,0.09,0.03,0,0,1.46,8.57 | |
September 2004,0.41000000000000003,0.41000000000000003,9.629999999999999,5.06,0.51,0,2.65,0,0.08,0.21,29.709999999999997,8.7,0,0,0.19,2.11,0.19,7.03,19.49,2.7199999999999998,0.4,0.41000000000000003,0.1,0.03,0,0,1.55,8.41 | |
October 2004,0.4,0.38,9.5,5.3100000000000005,0.53,0,2.77,0,0.09,0.2,29.12,8.469999999999999,0,0,0.22,2.2399999999999998,0.2,7.17,19.34,2.92,0.42,0.45999999999999996,0.11,0.04,0,0,1. |
This file has been truncated, but you can view the full file.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="generator" content="pandoc" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" /> |
This file contains 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
#%% package import | |
import pandas as pd | |
import numpy as np | |
import seaborn as sns | |
import os | |
import shutil | |
import xml.etree.ElementTree as ET | |
import glob | |
import json |
This file contains 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
{ | |
"Filter DataFrame": { | |
"prefix": "df_filt", | |
"body": [ | |
"${1:df_filt} = ${2:df_raw}[${2:df_raw}['${3:Column}'] ${4|==, >, >=, <, <=, !=|} ${5:Filter}] " | |
], | |
"description": "Filter a Pandas DataFrame" | |
} | |
} |
This file contains 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 Packages": { | |
"prefix": "import_typical", | |
"body": [ | |
"#%% package import", | |
"import numpy as np", | |
"import pandas as pd", | |
"import matplotlib.pyplot as plt" | |
], | |
"description": "Import typical packages" |
This file contains 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
#%% test model | |
test_sentences = ['How many Democrats does it take to screw in a light bulb? Just one, but it really gets screwed.', 'A conservative is a man who sits and thinks; mostly sits.'] | |
nlp_model(test_sentences) |
This file contains 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
president = 'Trump' | |
df_filt = df.loc[df['source']==president, ['text', 'stars']].copy() | |
list(zip(df_filt['text'], df_filt['stars'])) |
This file contains 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
fig = px.bar(df_grouped[df_grouped['source']==president], | |
x="stars", y="count", color="stars", | |
color_discrete_sequence= px.colors.sequential.Plasma_r | |
) | |
fig.show() |
NewerOlder