Skip to content

Instantly share code, notes, and snippets.

View gtfuhr's full-sized avatar
🖥️
Working from home

Gabriel Tobias Fuhr gtfuhr

🖥️
Working from home
View GitHub Profile
@gtfuhr
gtfuhr / addFeature.py
Last active March 11, 2020 17:45
Gists of the post about how to add new rows to a Pandas DataFrame
oscars = pd.DataFrame(data=[5, 1, 3, 0], columns=["oscars"])
print(oscars)
@gtfuhr
gtfuhr / gist:ba877113650c9a45001bfbf384d648a1
Created March 11, 2020 16:13
Creat dataFrame about movies
import pandas as pd
import numpy as np
movie_data = pd.DataFrame(data=[["Gladiator",8.5,"Russell Crowe"],
["Pulp Fiction",8.9,"John Travolta"],
["The Godfather",9.2,"Marlon Brando"]],
columns=["movie","imdb_rating","starring"])
print(movie_data)
@gtfuhr
gtfuhr / generate_report.py
Created March 3, 2020 18:28
Generate Pandas-Profiling report
profile.to_notebook_iframe()
@gtfuhr
gtfuhr / create_profile_report.py
Created March 3, 2020 18:26
Creates Pandas-Profile report
# Here is the function that generates the report using Pandas-Profiling
profile = ProfileReport(df, title='Graduate Admission', html={'style':{'full_width':True}})
# Hint! If you were using a large dataset, set the minimal named argument to True
# profile = ProfileReport(large_dataset, minimal=True)
# It is also recommended to open the report as a html file, in this way Jupyter-Notebook
# does not becames laggy because of the big Jupyter-Notebook cell
profile.to_file(output_file="largeDatasetProfileReport.html")
@gtfuhr
gtfuhr / import_dataframe.py
Created March 3, 2020 18:24
Import Data Science Libraries and Dataset from CSV
# First, as we normally do, we are going to import pandas and numpy
import numpy as np
import pandas as pd
# Thats where we import the function that will generate the ProfileReport
from pandas_profiling import ProfileReport
# Loads the dataset with the admission probability of various students and their
# scores in different tests of knowledge
df = pd.read_csv("Admission_Predict_Ver1.1.csv", encoding = 'unicode_escape')