Skip to content

Tag: python

Convert list of strings SymPy to symbols and use in solveset

The post “How can I convert a list of strings into sympy variables?” discusses how to generate SymPy symbols from a list of strings. My question is what steps are needed to use these symbols x, y and z in SymPy calculations? I tried something along the lines but I get the error “NameError: n…

Shuffle rows of a large csv

I want to shuffle this dataset to have a random set. It has 1.6 million rows but the first are 0 and the last 4, so I need pick samples randomly to have more than one class. The actual code prints only class 0 (meaning in just 1 class). I took advice from this platform but doesn’t work. Answer Because

How to format a number from thousands to K style in plotly

I want to change the format of y-axis from thousands to thousands in K format in plotly python. Answer Since you didn’t provide any data, or even explain what you want to show exactly on the y-axis, I will answer with what should work: If you want regularly-spaced tick values for the y-axis, you can eit…