Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 7fd46b5

Browse files
authored
📦 Updates
1 parent 36f9a12 commit 7fd46b5

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# pip install dataprep
2+
from dataprep.eda import create_report
3+
from dataprep.eda import plot
4+
from dataprep.eda import plot_correlation
5+
from dataprep.eda import plot_missing
6+
7+
# Full Report
8+
create_report(df)
9+
10+
# Plots
11+
plot(df)
12+
13+
# Correlations
14+
plot_correlation(df)
15+
16+
# Missing Values
17+
plot_missing(df)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Libraries
2+
import pandas as pd
3+
import matplotlib.pyplot as plt
4+
from wordcloud import WordCloud # pip install wordcloud
5+
import numpy as np
6+
7+
# Function to generate word clouds
8+
def generate_wordcloud(df, column, max_font_size=60, mask, collocations=False):
9+
text = df[column].values
10+
return WordCloud(
11+
max_font_size=max_font_size
12+
, collocations=collocations).generate(str(text)
13+
, mask=mask
14+
)
15+
16+
# Generating and Plotting Word Cloud
17+
mask = np.array(Image.open(path.join(d, "stormtrooper_mask.png")))
18+
wordcloud = generate_wordcloud(df, 'video_title') # or any string feature
19+
plt.imshow(wordcloud)
20+
plt.axis('off')
21+
plt.show()

0 commit comments

Comments
 (0)