How do we plot a histogram for non-numeric data with an initial condition?
up vote
-1
down vote
favorite
I'm working on a huge dataset with 271116 rows. I was trying to plot a bar graph of categorical data depending on the frequency with which they appear using this piece of code -
fig, ax = plt.subplots()
df['Team'].value_counts().plot(ax = ax, kind= 'bar', width = 0.8, figsize = (10,10))
plt.show()
Since there are a lot of categories, I can't make any sense of the
graph:

So, I thought of filtering the data that I'm plotting by plotting only those categories with a frequency greater than 500. How do I achieve such a plot?
python matplotlib graph data-analysis
add a comment |
up vote
-1
down vote
favorite
I'm working on a huge dataset with 271116 rows. I was trying to plot a bar graph of categorical data depending on the frequency with which they appear using this piece of code -
fig, ax = plt.subplots()
df['Team'].value_counts().plot(ax = ax, kind= 'bar', width = 0.8, figsize = (10,10))
plt.show()
Since there are a lot of categories, I can't make any sense of the
graph:

So, I thought of filtering the data that I'm plotting by plotting only those categories with a frequency greater than 500. How do I achieve such a plot?
python matplotlib graph data-analysis
You can filter aSeriesas usual,s[s>500].
– ImportanceOfBeingErnest
Nov 8 at 11:38
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I'm working on a huge dataset with 271116 rows. I was trying to plot a bar graph of categorical data depending on the frequency with which they appear using this piece of code -
fig, ax = plt.subplots()
df['Team'].value_counts().plot(ax = ax, kind= 'bar', width = 0.8, figsize = (10,10))
plt.show()
Since there are a lot of categories, I can't make any sense of the
graph:

So, I thought of filtering the data that I'm plotting by plotting only those categories with a frequency greater than 500. How do I achieve such a plot?
python matplotlib graph data-analysis
I'm working on a huge dataset with 271116 rows. I was trying to plot a bar graph of categorical data depending on the frequency with which they appear using this piece of code -
fig, ax = plt.subplots()
df['Team'].value_counts().plot(ax = ax, kind= 'bar', width = 0.8, figsize = (10,10))
plt.show()
Since there are a lot of categories, I can't make any sense of the
graph:

So, I thought of filtering the data that I'm plotting by plotting only those categories with a frequency greater than 500. How do I achieve such a plot?
python matplotlib graph data-analysis
python matplotlib graph data-analysis
edited Nov 8 at 11:24
Bart
4,36321841
4,36321841
asked Nov 8 at 11:09
Rithvik K
185
185
You can filter aSeriesas usual,s[s>500].
– ImportanceOfBeingErnest
Nov 8 at 11:38
add a comment |
You can filter aSeriesas usual,s[s>500].
– ImportanceOfBeingErnest
Nov 8 at 11:38
You can filter a
Series as usual, s[s>500].– ImportanceOfBeingErnest
Nov 8 at 11:38
You can filter a
Series as usual, s[s>500].– ImportanceOfBeingErnest
Nov 8 at 11:38
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206538%2fhow-do-we-plot-a-histogram-for-non-numeric-data-with-an-initial-condition%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You can filter a
Seriesas usual,s[s>500].– ImportanceOfBeingErnest
Nov 8 at 11:38