![]() ![]() # Remove outliers (with a change that is larger than 0.1)ĭf_aapl = df_aaplĭf_aapl = df_aapl.assign(Volume=df_(np.log))įig = px.scatter_3d(df_aapl, x='year', y='month', z='change', color='Volume', size_max=1) # Assign the year, month and weekday to the DataFrameĭf_aapl = df_aapl.assign(year=df_.year, month=df_.month, weekday=df_.weekday)ĭf_aapl = df_aapl.assign(change=df_change()) import yfinance as yfĭf_aapl = yf.download('AAPL', start='', end='').reset_index()ĭf_aapl = df_aapl.assign(DateTime=pd.to_datetime(df_aapl.Date)) For this scatter plot, we will download stock data and plot the year on the x-axis, the month on the y-axis and the change on the z-axis. ![]() ![]() That is not possible using only Matplotlib. We can also create a scatter plot in 3 dimensions. Then, we can create a simple DataFrame based on random numbers (in a 25×3 matrix) and plot the results using Plotly: df = pd.DataFrame(np.random.randn(25, 3), columns=) We will start by importing the required libraries for Plotly: import pandas as pdįrom plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot The most simple plot is a line plot which is the first plot that we will create. In this first blog post on this topic, we will go through the steps needed for creating a basic line Python plot and a 3D scatter plot. This blog series is a beginners’ tutorial on how you can make interactive plots in a Jupyter notebook using Plotly Express. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |