<commit_before>package com.github.lwhite1.tablesaw.examples;

import com.github.lwhite1.tablesaw.api.CategoryColumn;
import com.github.lwhite1.tablesaw.api.ColumnType;
import com.github.lwhite1.tablesaw.api.Table;

import static com.github.lwhite1.tablesaw.api.ColumnType.*;
import static com.github.lwhite1.tablesaw.api.QueryHelper.column;

/**
 * Usage example using a Tornado dataset
 */
public class TornadoExample {

  public static void main(String[] args) throws Exception {

    Table tornadoes = Table.createFromCsv(COLUMN_TYPES_OLD, "data/1950-2014_torn.csv");
    assert(tornadoes != null);

    out(tornadoes.structure().print());
    out();

    tornadoes.removeColumns("Number", "Year", "Month", "Day", "Zone", "State FIPS", "Loss", "Crop Loss", "End Lat", "End Lon", "NS", "SN", "SG", "FIPS 1", "FIPS 2", "FIPS 3", "FIPS 4");

    tornadoes.exportToCsv("data/tornadoes_1950-2014.csv");

    //tornadoes = Table.createFromCsv(COLUMN_TYPES, "data/tornadoes_1950-2014.csv");
    tornadoes = Table.create("data/tornadoes_1950-2014.csv");
    assert(tornadoes != null);

    out(tornadoes.structure().print());
    out(tornadoes.structure().selectWhere(column("Column Type").isEqualTo("INTEGER")).print());

    tornadoes.setName("tornadoes");

    out();
    out("Column names");
    out(tornadoes.columnNames());

    out();
    out("Remove the 'State No' column");
    tornadoes.removeColumns("State No");
    out(tornadoes.columnNames());

    out();
    out("print the table's shape:");
    out(tornadoes.shape());

    out();
    out("Use first(3) to view the first 3 rows:");
    out(tornadoes.first(3).print());

    out();
    out("Extact month from the date and make it a separate column");
    CategoryColumn month = tornadoes.dateColumn("Date").month();<commit_msg>fixed test<commit_after>package com.github.lwhite1.tablesaw.examples;

import com.github.lwhite1.tablesaw.api.CategoryColumn;
import com.github.lwhite1.tablesaw.api.ColumnType;
import com.github.lwhite1.tablesaw.api.Table;

import static com.github.lwhite1.tablesaw.api.ColumnType.*;
import static com.github.lwhite1.tablesaw.api.QueryHelper.column;

/**
 * Usage example using a Tornado dataset
 */
public class TornadoExample {

  public static void main(String[] args) throws Exception {

    Table tornadoes = Table.createFromCsv(COLUMN_TYPES_OLD, "data/1950-2014_torn.csv");
    assert(tornadoes != null);

    out(tornadoes.structure().print());
    out();

    tornadoes.removeColumns("Number", "Year", "Month", "Day", "Zone", "State FIPS", "Loss", "Crop Loss", "End Lat", "End Lon", "NS", "SN", "SG", "FIPS 1", "FIPS 2", "FIPS 3", "FIPS 4");

    tornadoes.exportToCsv("data/tornadoes_1950-2014.csv");

    //tornadoes = Table.createFromCsv(COLUMN_TYPES, "data/tornadoes_1950-2014.csv");
    tornadoes = Table.createFromCsv("data/tornadoes_1950-2014.csv");
    assert(tornadoes != null);

    out(tornadoes.structure().print());
    out(tornadoes.structure().selectWhere(column("Column Type").isEqualTo("INTEGER")).print());

    tornadoes.setName("tornadoes");

    out();
    out("Column names");
    out(tornadoes.columnNames());

    out();
    out("Remove the 'State No' column");
    tornadoes.removeColumns("State No");
    out(tornadoes.columnNames());

    out();
    out("print the table's shape:");
    out(tornadoes.shape());

    out();
    out("Use first(3) to view the first 3 rows:");
    out(tornadoes.first(3).print());

    out();
    out("Extact month from the date and make it a separate column");
    CategoryColumn month = tornadoes.dateColumn("Date").month();
{'fraction_non_alphanumeric': 0.16657350475125768, 'fraction_numerical': 0.02515371716042482, 'mean_word_length': 4.406344410876133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7591254', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1220, 'n_words': 238}