What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-16 11:05:04
dataframe no names from file
df = pd.read_csv(file_path, header=None) Add solution -
Python 2021-10-14 19:04:05
Comparison of two csv file and output with differences?
import pandas as pd df1 = pd.read_csv('old.csv') df2 = pd.read_csv('new.csv') df1['flag'] = 'old' df2['flag'] = 'new' df = pd.concat([df1, df2]) dups_dropped = df.drop_duplicates(df.columns.difference(['flag']), keep=False) dups_dropped.to_csv('update... Add solution -
Other 2021-10-14 12:54:06
streamlit change bkgrd color based on value
import pandas as pd import streamlit as st # https://stackoverflow.com/questions/43596579/how-to-use-python-pandas-stylers-for-coloring-an-entire-row-based-on-a-given-col df = pd.read_csv("data/titanic.csv") def highlight_survived(s): re... Add solution -
Python 2021-10-13 02:54:04
ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'.
import pandas as pd import io temp=u"""a;b;c 1;1,8 1;2,1 1;3,6 1;4,3 1;5,7 """ #after testing replace io.StringIO(temp) to filename df = pd.read_csv(io.StringIO(temp), sep="[;,]", engine='python') print (df) a ... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5