Answers for "create new env conda"

50

conda create environment

conda create -n myenv python=3.6
Posted by: Guest on October-01-2020
6

conda export environment

# conda export environment.yml
conda env export > environment.yml

# conda create environment from file (Same environment name)
conda env create -f environment.yml
Posted by: Guest on February-09-2021
15

anaconda remove environment

conda env remove -n ENV_NAME
Posted by: Guest on May-17-2020
0

Create a new environment - Conda

conda create --name myenv
#Figure([go.Scatter(...), go.Bar(...)])



# Plotting histogram and figures using a class in Python
import plotly.graph_objects as go
from plotly.graph_objs import Figure, Scatter, Bar
import matplotlib.pyplot as plt
import plotly.express as px

def plot_data(self):
        title = f'{self.symbol}: Closing Prices (Start: {self.start} - End: {self.end})'
        fig = self.plot_whole(data = self.data['price'], title = title, label = self.symbol)
        fig.show()
    
    def plot_whole(self, data, title, label):
        fig = Figure([
                go.Scatter(
                    name = f'{label}',
                    x = data.index,
                    y = data.values,
                    mode = 'lines',
                    marker = dict(color="#0a0a0a"),
                    line = dict(width=2),
                    showlegend = True
                )
            ])
        fig.update_layout(yaxis_title='USD ($)', 
                          xaxis_title='Timestamp', 
                          title=f'{title}', 
                          hovermode="x")
        return fig
        
    def add_plots(self, fig, data, label, color):
        fig.add_trace(
                go.Scatter(  
                    name=f'{label}',
                    x=data.index,
                    y=data.values, 
                    marker = dict(color=f"{color}"),
                    line = dict(width=2),
                    mode='lines',                
                    fillcolor='rgba(68, 68, 68, 0.3)',
                    showlegend=True
                )
            )
        return fig
    
    def add_bar_plots(self, fig, data, label, color):
        fig.add_trace(
                go.Bar(  
                    name=f'{label}',
                    x=data.index,
                    y=data.values, 
                    showlegend = True,
                    marker = dict(color=f"{color}"), 
                )
            )
        return fig
    
    def add_line(self, fig, index, line_pos, label, color):
        fig.add_trace(
                go.Scatter(  
                    name=f'{label}',
                    x = index,
                    y = [line_pos]*len(index),
                    marker = dict(color=f"{color}"), # color picker
                    line = dict(width=2),
                    mode='lines',                
                    fillcolor='rgba(68, 68, 68, 0.3)',
                    showlegend=True
                )
            )
        return fig
    
    def add_signal_plots(self, fig, colname, color): 
        if not self.data[colname].isnull().all():
            fig.add_trace(
                go.Scatter(  
                    name= f'{colname}',
                    x = self.data.index,
                    y = self.data[f'{colname}'],
                    marker = dict(color=f'{color}'), # color picker
                    line = dict(width=1),              
                    mode = "markers", 
                    fillcolor = 'rgba(68, 68, 68, 0.3)',
                    showlegend = True
                )
            )
        return fig
    
    def plotMACD(self):
        fig = self.plot_whole(self.data['MACD'], 'MACD', 'MACD Line')
        nonnegative = self.data['MACD_Histogram'][(self.data['MACD_Histogram']>=0)]
        negative = self.data['MACD_Histogram'][(self.data['MACD_Histogram']<0)]
        fig = self.add_bar_plots(fig, nonnegative, 'Non-negative Histogram', "#0a0a0a")
        fig = self.add_bar_plots(fig, negative, 'Negative Histogram', 'red')
        self.add_plots(fig, self.data['MACD_Signal'], 'MACD Signal Line', 'red').show()
Posted by: Guest on June-16-2021
0

make a new environment conda

conda create -n test_env python=3.6.3 anaconda
Posted by: Guest on December-02-2020
1

conda create new env

conda create -n 
	NAME
		python=3.8
Posted by: Guest on January-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language