Size: 513
Comment:
|
Size: 1021
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 21: | Line 21: |
path = '/Path' import pandas as pd |
path = '/path/to/file(s)' df = pd.read_csv(path + 'name.csv', sep=';', header=0, dtype={'Force String Column': str}, parse_dates=['Date Column'] encoding='utf-8') |
Line 25: | Line 26: |
== Renaming Columns == |
|
Line 26: | Line 29: |
import numpy as np import pandas as pd }}} |
dt.rename(columns={'File column name 1': 'Column1', 'File column name 2': '2'}, inplace=True) }} == Do Y for each value in column X == {{{#!highlight python df.loc[:, ['X']] = df.loc[:, ['X']].apply(lambda x: x.Y) }} == Renaming Columns == {{{#!highlight python dt.rename(columns={'File column name 1': 'Column1', 'File column name 2': '2'}, inplace=True) }} |
Description
Pandas is a fast, powerful, flexible and easy to use open source data analysis and manipulation tool, built on top of the Python programming language.
Snippets
Standard import
Read CSV file