Created
November 15, 2018 20:18
-
-
Save alpercalisir/c90897a5c8a15665a2171ecc904686ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
fields = ['FACE_X','FACE_Y','FACE_WIDTH','FACE_HEIGHT'] | |
df = pd.read_csv('a.txt', usecols=fields) | |
df['FACE_WIDTH']=df['FACE_X']+df['FACE_WIDTH'] | |
df['FACE_HEIGHT']=df['FACE_Y']+df['FACE_HEIGHT'] | |
# Some indexes may contain NAN | |
# All contain NA or inf and not possible to convert integer | |
# Shows the Null index | |
# for index, row in df['FACE_X'].iteritems(): | |
# if row != row: | |
# print('index:', index, 'isnull') | |
# What needs to be done if we have NAN | |
# df['FACE_X'].fillna(0).astype(int) | |
np.savetxt(r'b.txt', df.values, fmt='%d') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment