What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-24 21:25:02
seaborn heatmap spearman correlation coefficient
# credit to Stack Overflow user in the source link import pandas as pd import seaborn as sns import matplotlib.pyplot as plt A = [...] # insert here your list of values for A B = [...] # insert here your list of values for B df = pd.DataFrame({'A': A, ... Add solution -
Python 2021-11-21 19:03:18
python plot a dictionary
# credit to the Stack Overflow user in the source link import matplotlib.pylab as plt lists = sorted(d.items()) # sorted by key, return a list of tuples x, y = zip(*lists) # unpack a list of pairs into two tuples plt.plot(x, y) plt.show() Add solution -
Python 2021-11-14 11:22:23
pretty print pandas dataframe
# credit to Stack Overflow user in the source link from tabulate import tabulate import pandas as pd df = pd.DataFrame({'col_two' : [0.0001, 1e-005 , 1e-006, 1e-007], 'column_3' : ['ABCD', 'ABCD', 'long string', 'ABCD']}) print(tabula... Add solution -
Other 2021-11-14 07:25:09
Define a new function called do_four that takes a function object and a value and calls the function four times, passing the value as a parameter. There should be only two statements in the body of this function, not four.
Stack Overflow requires cookies for authentication -- are your browser cookies enabled for this domain? Add solution -
Python 2021-11-11 20:54:11
pandas dataframe from multiple csv
# credit to Stack Overflow user in source link import pandas as pd import glob path = r'C:\DRO\DCL_rawdata_files' # use your path all_files = glob.glob(path + "/*.csv") li = [] for filename in all_files: df = pd.read_csv(filename, index_... Add solution -
Other 2021-11-09 14:09:08
add text to videoo android ffmpeg in spasific position
ffmpeg -i input.mp4 -vf drawtext="fontfile=/path/to/font.ttf: \ text='Stack Overflow': fontcolor=white: fontsize=24: box=1: [email protected]: \ boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2" -codec:a copy output.mp4 Add solution -
Python 2021-10-29 02:35:14
python scatter plot legend
# credit to the Stack Overflow user in the source link import matplotlib.pyplot as plt from numpy.random import random colors = ['b', 'c', 'y', 'm', 'r'] lo = plt.scatter(random(10), random(10), marker='x', color=colors[0]) ll = plt.scatter(random(10),... Add solution -
Python 2021-10-28 14:54:07
python detect warning
# credit to Stack Overflow user in source link import warnings def fxn(): warnings.warn("deprecated", DeprecationWarning) with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. warnings.simple... Add solution