Snippets Collections
import pandas as pd
from sklearn.model_selection import train_test_split

# Load the data from the CSV file
data = pd.read_csv("data.csv")

# Split the data into train and validation sets, using 85% of the data for training and 15% for validation for the "labels" column
train_data, validation_data = train_test_split(data, train_size=0.85, test_size=0.15, random_state=42, stratify=data["labels"])

# Write the train and validation datasets to CSV files
train_data.to_csv("train.csv", index=False)
validation_data.to_csv("valid.csv", index=False)
Set(varSplitText, (Concat(LastN(Split(TextBoxNew.Text, "=").Result, CountRows(Split("https://www.youtube.com/watch?v=", "=").Result) -1),Result
)));
### MAKE DIR
mkdir split && cd split

### SPLIT FILE
split -l 1000 /<path>/output-google.sql /<path>/split/split-

### CHANGE EXTENTION
ls | xargs -I % mv % %.sql
star

Wed Dec 07 2022 08:28:42 GMT+0000 (UTC) https://chat.openai.com/chat

#python #datasets #split #train #validation
star

Mon Dec 27 2021 04:24:14 GMT+0000 (UTC) https://stackoverflow.com/

#split #sql #large-sql

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension