Tuesday , March 19 2024

Data Science

Data Visualization in Pandas – Data Science Tutorials

Data Visualization in Pandas - Data Science Tutorials

16- Data Visualization Data Visualization in Pandas¶ In [1]: #importing the libraries import matplotlib.pyplot as plt import numpy as np import pandas as pd Plotting graph with plot() method¶ In [2]: data=pd.Series(np.random.randn(1000).cumsum()) data Out[2]: 0 -0.584127 1 -1.377490 2 -0.882970 3 0.461625 4 0.822463 ... 995 -28.696661 996 -28.190823 997 -29.000591 998 …

Read More »

Pivot Tables – Data Science Tutorials

Pivot Tables - Data Science Tutorials

15- Pivot Tables Pivot Tables¶The Pandas pivot_table() is used to calculate, aggregate, and summarize your data. It is defined as a powerful tool that aggregates data with calculations such as Sum, Count, Average, Max, and Min. It also allows the user to sort and filter your data when the pivot …

Read More »

Groupby in Pandas – Data Science Tutorials

Groupby in Pandas - Data Science Tutorials

14- Groupby Groupby in Pandas¶Pandas groupby is used for grouping the data according to the categories and apply a function to the categories. It also helps to aggregate data efficiently. In [2]: #import the libraries import pandas as pd import numpy as np In [3]: ipl_data = {'Team': ['Riders', 'Riders', 'Devils', 'Devils', …

Read More »

Hierarchical Indexing – Data Science Tutorials

Hierarchical Indexing - Data Science Tutorials

12- Hierarchical Indexing Hierarchical Indexing¶ Up to this point we’ve been focused primarily on one-dimensional and two-dimensional data, stored in Pandas Series and DataFrame objects, respectively. Often it is useful to go beyond this and store higher-dimensional data—that is, data indexed by more than one or two keys. While Pandas …

Read More »

JSON and Quandl API Data – Data Science Tutorials

JSON and Quandl API Data - Data Science Tutorials

09 – JSON and Quandl API Data JSON and Quandl API Data¶ https://data.nasdaq.com/data/BSE-bombay-stock-exchange In [ ]: pip install quandl Get Data by Quandl API¶ In [1]: import quandl data = quandl.get("BSE/BOM543207", authtoken="x8VdDXzBty3iGsaRLTVs") data Out[1]: Open High Low Close WAP No. of Shares No. of Trades Total Turnover Deliverable Quantity % Deli. Qty to …

Read More »

Sorting in Pandas – Data Science Tutorials

Sorting in Pandas

07- Sorting and Ranking Sorting in Pandas¶There are two kinds of sorting available in pandas: Sort by index Sort by value In [1]: #import the libraries import pandas as pd import numpy as np Sorting for Series¶Sort by index Sorting by index can be done by using sort_index command. In [2]: s=pd.Series([67,45,23,6,12,57],index=["e","d","a","f","b","c"]) …

Read More »