Questions tagged as 'pandas'

2
answers

Counting 'nan' and 'null' values in a pandas dataframe

Imagine that we have a CSV file called data.csv: col1 col2 col3 col4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 33 44 import numpy as np import pandas as pd po =...
asked by 24.06.2018 / 21:52
1
answer

Pandas - select rows

Hello. How do I select a specific row in a dataframe? df1=pd.read_csv('arquivo1.csv', encoding='ISO-8859-1', sep=";") I have tried to df.index[2] , but it gives error. The 2 is the line I want.     
asked by 02.11.2017 / 18:05
1
answer

Remove duplicate dates by adding values

I need to remove the duplicate dates from the dataframe and add the values corresponding to those dates. I found an answer in the NA stack that is close to the one I need, but I could not shape it for my need: df.groupby('data', group_keys=...
asked by 21.06.2017 / 21:54
1
answer

Python Python too slow

Can anyone help me? I'm reading from a file, I make some changes and then saved to another folder. but this takes 2 hours, the file has 15 million lines, would it have some different and more effective method? # LER ARQUIVO NA PASTA STAGING ar...
asked by 17.10.2018 / 19:52
1
answer

How do I filter data by date in a dataframe (Python)

Being that you would have to create a new dataframe with the information coming from those dates below. import pandas as pd import numpy as np import datetime %matplotlib inline races = pd.read_csv('races.csv') results = pd.read_csv('results.c...
asked by 20.04.2018 / 10:11
1
answer

Python Pandas: rewriting pd.read_table () with the original comments

I have a separate tab file in which the first few lines are comments designated with '#'. I use the following code to pull the file without the comments ... The file looks something like: #comentario #comentario #comentario #comentario #coment...
asked by 03.03.2017 / 14:36
3
answers

How to install the Pandas library in Python 3

I would like to know how to install the Pandas library in Manjaro, in Python version 3.4.3 -     
asked by 08.04.2015 / 19:45
1
answer

Pandas: comparing information in DataFrame

I have 2 DataFrames imported from CSV CSV1 4616; CCIVIL_03/decreto/2003/D4616.htm 4617; CCIVIL_03/decreto/2003/D4617.htm 4618; CCIVIL_03/decreto/2003/D4618.htm 4619; CCIVIL_03/decreto/2003/D4619.htm 4620; CCIVIL_03/decreto/2003/D4620.htm 46...
asked by 06.06.2018 / 19:15
1
answer

Separating a dataframe by some criteria - Python Pandas

I have a csv file with more than 500,000 lines that I would like to separate into two dataframes. The format of each line: date, time, value of the variable of interest dd-mm-aa, hh: mm: 00, float The lines are recorded every minute. In...
asked by 03.06.2018 / 02:45
1
answer

Data classification of network attacks (attack or non-attack)

I'm using the dataset: https://www.unsw.adfa.edu.au/unsw-canberra-cyber/cybersecurity/ADFA-NB15-Datasets/ The purpose is to classify a sample as attack or non-attack. Is it a good idea to use logistic regression? I made the code below to...
asked by 10.06.2018 / 21:46