Python Pandas df.min() returns inf
<p>I have been working on a Python code to take data from a CSV file and paste it to a new Excel document. I am using Python 2.7, Numpy and Pandas.</p>

<p>I am able to:</p>

<ul>
<li>read the CSV file </li>
<li>Isolate the column I'm interested in</li>
<li>Write to a new Excel file</li>
</ul>

<p>I am unable to:</p>

<ul>
<li>find the minimum value within that isolated column</li>
</ul>

<p>What I tried:</p>

<ul>
<li>Google</li>
<li>Trying to replace inf to NaN and remove</li>
</ul>

<p>I added the following lines after the:</p>

<pre><code>print(DTFRL.min())
</code></pre>

<p>line of code</p>

<pre><code>DTFRL.replace([np.inf, -np.inf], np.nan)
DTFRL.replace([np.inf, -np.inf], np.nan).dropna(subset=["col1", "col2"], how="all")
</code></pre>

<p>My code without the above addition is as follows:</p>

<pre><code># James Hayek
# Takes input from a CSV file and exports the data to
# an Excel document

# Goals:
#   1. Import the highest or lowest value in CSV file
#   2. Place the value in a specific column in an Excel file
#   3. Incriment through a slew of CSV files
#   4. Open all CSV files from a file path that the user picks

import numpy as np
import pandas as pd
pd.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier. See warning, change later

#This line reads the entire data set from the CSV file
DTFRL_df = pd.read_csv('C:\\Users\\James\\OneDrive\\Documents\\cSquared\\ExcelPythonAutomation\\CSVFiles\\31-SPT76-ANT123-DTF.csv', sep=',', error_bad_lines=False)
DTFRL = DTFRL_df.iloc[0:1100,1] #Setting a variable for the DTF-RL column

#print(DTFRL_df.iloc[0:1100,1]) #This prints all the rows and just the second column

print(DTFRL.min()) #Atempting to print the lowest value in the second column, but getting inf instead

DTFRL.replace([np.inf, -np.inf], np.nan)
DTFRL.replace([np.inf, -np.inf], np.nan).dropna(subset=["col1", "col2"], how="all")

#This line writes the variable DTRFL_df to a new Excel file, can change variable to write later
#to make sure we just write the lowest value found 
DTFRL.min().to_excel('C:\\Users\\James\\OneDrive\\Documents\\cSquared\\ExcelPythonAutomation\\test.xlsx')
</code></pre>

<p>My Question:</p>

<ul>
<li>What do I need to specify in .dropna(subset=["?", "?"]) to irradicate the inf value returned as oposed to the lowest float?</li>
</ul>

<p>Thanks in advance for the help</p>

<p>Here is the head of the CSV file to reproduce the issue.</p>

<pre>
Title,SubTitle,
DTF-RL,,
Parameter Name,Setting,
Resolution:,1033,
CAL:,On (OSL-Std),
RF Immunity:,High,
Std:,None,
Freq: Start/Stop:,698.0 MHz/2700.0 MHz,
Date:,"Thursday, December 17, 2015",
Time:,8:08:26 PM,
Ins. Loss:,0.045 dB/ft,
Model:,S331L,
Serial:,1307024,
Prop.Vel:,0.865,
Marker Data,,
Marker,Distance( ft),Value
M1,85.63468992,-1.017566517
Limit On,Value: 25.00,
Point Data,,
Distance( ft),DTF-RL,
0,43.37040226,
0.121124031,41.60694628,
0.242248062,42.73552301,
0.363372093,49.25223571,
0.484496124,65.76120197,
0.605620155,71.70100065,
0.726744186,68.81150462,
</pre>

<p>The file can be accessed <a href="https://drive.google.com/open?id=0BxNGritBJp1zTV9MX3U1bngyWUE" rel="nofollow noreferrer">here</a>.</p>