Nice little interactive data widget with accordion example.
import panel as pn
import param as pm
import numpy as np
import pandas as pd
import hvplot.pandas
class SimplePlotExample(pm.Parameterized):
from streamz import Stream | |
def market_step(market_inputs): | |
return {'market_movement': market_inputs['market_movement']} | |
def write(x): | |
print(x) | |
def f(n=5): | |
source = Stream(asynchronous=True) # Configure the stream for asynchronous operation |
import pandas as pd | |
import hvplot.pandas | |
df = pd.DataFrame({'x':range(10),'y':range(10), 'z':range(10)}) | |
df.hvplot.step(x='x').opts(legend_position='top_left') | |
df = pd.DataFrame({'x':range(10),'y':range(10),'z':range(10)}) | |
df.hvplot.line(x='x', legend='left') |
import param as pm | |
import panel as pn | |
import hvplot.pandas | |
import pandas as pd | |
import numpy as np | |
pn.extension() | |
class ResettableParameterized(pm.Parameterized): | |
def _reset(self): | |
with pm.parameterized.batch_call_watchers(self): |
import param as pm | |
import panel as pn | |
import hvplot.pandas | |
import pandas as pd | |
import numpy as np | |
pn.extension() | |
class Test(pm.Parameterized): | |
y = pm.Number(10, bounds=(0,20)) | |
def view(self): |
Nice little interactive data widget with accordion example.
import panel as pn
import param as pm
import numpy as np
import pandas as pd
import hvplot.pandas
class SimplePlotExample(pm.Parameterized):
Add the following to alacritty:
key_bindings:
- { key: I, mods: Control, chars: "\x1b[105;6u" }
Source: NvChad/NvChad#1551 (comment)
I'm looking for a canonical way of displaying the name property of dataframes when printing or logging.
Here is a module that overrides print with a method that prints dataframes with their names if they have the name property, and prints normally otherwise.
import builtins
import pandas as pd
import numpy as np | |
import pandas as pd | |
import hvplot.pandas | |
labels = list('ABC') | |
states = 4 | |
xs = 100 | |
df = pd.DataFrame({'x': len(labels)*states*list(range(xs)), 'label': [l for l in labels for _ in range(states*xs)], 'State': len(labels)*[s for s in list(range(states)) for _ in range(xs)], 'Value': 0.52+np.random.rand(len(labels)*states*xs)}) |