{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyO3VCeqKEjhcmxcfSy646LE"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["# Histograms\n","\n","The `.plot.hist()` method will generate a histogram. We can also use `.hist()` to generate a histogram."],"metadata":{"id":"QENK4w9tEo7o"}},{"cell_type":"code","source":["import pandas as pd, numpy as np # import statmeents\n","\n","# generate random data\n","df = pd.DataFrame({\"a\": np.random.randn(1000) + 1, \"b\": np.random.randn(1000), \"c\": np.random.randn(1000) - 1,}, columns=[\"a\", \"b\", \"c\"],)\n","df # inspect data"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":424},"id":"3RW43egqEtA3","executionInfo":{"status":"ok","timestamp":1706143471828,"user_tz":300,"elapsed":1227,"user":{"displayName":"Katherine Walden","userId":"17094108395123900917"}},"outputId":"6ffe5301-6419-468a-96b9-babbdc6e670f"},"execution_count":1,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" a b c\n","0 1.810398 0.207306 -1.719783\n","1 0.229618 1.878545 -0.869958\n","2 -0.393201 -0.054595 -0.952195\n","3 1.470702 0.612677 -0.366439\n","4 2.174134 0.468061 -1.417535\n",".. ... ... ...\n","995 1.944827 1.185007 -2.180961\n","996 0.763507 -0.420616 -1.165496\n","997 1.142902 0.248652 -1.112617\n","998 -0.246135 -0.601180 -0.623862\n","999 1.005845 -0.106212 -0.264363\n","\n","[1000 rows x 3 columns]"],"text/html":["\n","
\n"," | a | \n","b | \n","c | \n","
---|---|---|---|
0 | \n","1.810398 | \n","0.207306 | \n","-1.719783 | \n","
1 | \n","0.229618 | \n","1.878545 | \n","-0.869958 | \n","
2 | \n","-0.393201 | \n","-0.054595 | \n","-0.952195 | \n","
3 | \n","1.470702 | \n","0.612677 | \n","-0.366439 | \n","
4 | \n","2.174134 | \n","0.468061 | \n","-1.417535 | \n","
... | \n","... | \n","... | \n","... | \n","
995 | \n","1.944827 | \n","1.185007 | \n","-2.180961 | \n","
996 | \n","0.763507 | \n","-0.420616 | \n","-1.165496 | \n","
997 | \n","1.142902 | \n","0.248652 | \n","-1.112617 | \n","
998 | \n","-0.246135 | \n","-0.601180 | \n","-0.623862 | \n","
999 | \n","1.005845 | \n","-0.106212 | \n","-0.264363 | \n","
1000 rows × 3 columns
\n","