|
754 | 754 | "source": [ |
755 | 755 | "#How many survived\n", |
756 | 756 | "f,ax=plt.subplots(figsize=(5,5))\n", |
757 | | - "sns.countplot('Survived',data=df_titanic, ax = ax)\n", |
| 757 | + "sns.countplot(x='Survived',data=df_titanic, ax = ax)\n", |
758 | 758 | "ax.set_title('Perished vs. Survived')\n", |
759 | 759 | "#Not necessary, just to eliminate any output\n", |
760 | 760 | "plt.show()" |
|
857 | 857 | "source": [ |
858 | 858 | "#Male vs. Female\n", |
859 | 859 | "f,ax=plt.subplots(figsize=(5,5))\n", |
860 | | - "sns.countplot('Sex',data=df_titanic,ax=ax)\n", |
| 860 | + "sns.countplot(x='Sex',data=df_titanic,ax=ax)\n", |
861 | 861 | "ax.set_title('Male vs. Female')\n", |
862 | 862 | "plt.show()" |
863 | 863 | ] |
|
961 | 961 | "source": [ |
962 | 962 | "#Perished vs. Survived for male/female\n", |
963 | 963 | "f,ax=plt.subplots(figsize=(5,5))\n", |
964 | | - "sns.countplot('Sex',hue='Survived',data=df_titanic,ax=ax)\n", |
| 964 | + "sns.countplot(x='Sex',hue='Survived',data=df_titanic,ax=ax)\n", |
965 | 965 | "ax.set_title('Gender: Perished vs. Survived')\n", |
966 | 966 | "plt.show()" |
967 | 967 | ] |
|
1077 | 1077 | "source": [ |
1078 | 1078 | "#bar plot and seaborn countplot\n", |
1079 | 1079 | "f,ax=plt.subplots(figsize=(5,5))\n", |
1080 | | - "sns.countplot('Pclass',hue='Survived',data=df_titanic,ax=ax)\n", |
| 1080 | + "sns.countplot(x='Pclass',hue='Survived',data=df_titanic,ax=ax)\n", |
1081 | 1081 | "ax.set_title('Pclass:Perished vs. Survived')\n", |
1082 | 1082 | "plt.show()" |
1083 | 1083 | ] |
|
2208 | 2208 | "name": "python", |
2209 | 2209 | "nbconvert_exporter": "python", |
2210 | 2210 | "pygments_lexer": "ipython3", |
2211 | | - "version": "3.7.1" |
| 2211 | + "version": "3.9.16" |
2212 | 2212 | } |
2213 | 2213 | }, |
2214 | 2214 | "nbformat": 4, |
|
0 commit comments