What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-02 04:52:24
update csv file in python using pandas
I was able to get the desired data frame. import pandas as pd import numpy as np df1 = pd.read_csv('\\dir\\test1.csv', index_col=0) df2 = pd.read_csv('\\dir\\test2.csv', index_col=0) new_index = list(set(list(df1.index.values)+list(df2.index.values))) ... Add solution -
SQL 2021-11-22 02:58:12
Update All tables COLLATE DATABASE_DEFAULT
DECLARE @collate nvarchar(100); DECLARE @table nvarchar(255); DECLARE @column_name nvarchar(255); DECLARE @column_id int; DECLARE @data_type nvarchar(255); DECLARE @max_length int; DECLARE @row_id int; DECLARE @sql nvarchar(max); DECLARE @sql_column nvarc... 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 -
SQL 2021-11-04 14:46:13
Get a list of tables and the primary key
select schema_name(tab.schema_id) as [schema_name], tab.[name] as table_name, pk.[name] as pk_name, substring(column_names, 1, len(column_names)-1) as [columns] from sys.tables tab left outer join sys.indexes pk on tab.object_id ... Add solution -
Python 2021-11-04 11:19:10
torch timeseries
# Load dependencies from sklearn.preprocessing import MinMaxScaler # Instantiate a scaler """ This has to be done outside the function definition so that we can inverse_transform the prediction set later on. """ scaler = Min... Add solution -
Other 2021-10-29 20:41:14
medium generate-tsql-stored-procedures
CREATE proc [dbo].[USP_QuerycreationSupport](@table_Name varchar(100))asbeginDECLARE @InserCols NVARCHAR(MAX)DECLARE @Inserparam NVARCHAR(MAX)DECLARE @Insertquery NVARCHAR(MAX)DECLARE @Selectquery NVARCHAR(MAX)DECLARE @Update NVARCHAR(MAX)DECLARE @DeleteQ... Add solution -
Python 2021-10-14 04:01:03
pandas change column order
df = df.reindex(columns=column_names) Add solution