Answers for "read data in csv file python"

18

python read csv

# pip install pandas 
import pandas as pd

# Read the csv file
data = pd.read_csv('data.csv')

# Print it out if you want
print(data)
Posted by: Guest on October-03-2020
0

reading csv data

int main() {
    string line;
    vector<string> rawdata;
    ifstream file ( "/Users/mewtwo/Desktop/Programs/seals.csv" );
    while(getline(file, line)) {
        stringstream ss(line);
        while (getline(ss, line, ',')) {
            rawdata.push_back(line);
        }

    }
    cout << rawdata[55] << endl;
    
    
    return 0;
}
Posted by: Guest on August-02-2021

Python Answers by Framework

Browse Popular Code Answers by Language